Post image
Strategy

CREATE TELEGRAM BOT WITH PYTHON : web_design


Post image

In the course you will learn.

Some of advantages of having a telegram Bot as compared to Mobile App

How to setup a Telegram Bot

How to manage a Telegram Bot instance

How to use Telegram online Documentation

Using Python requests to interact with Telegram API

Use Python Wrapper around Telegram API

Working with Telegram commands

Working with Telegram messages

Handling Different media types of messages

How to implement Keyboard button

Working with Contact and Location Share buttons

Use Open Weather Map API

We will write code to get weather forecast from shared location

Put together complete Real-world application

https://video-course.com/2020/02/08/create-telegram-bot-with-python/



Source link

A great tool for analyzing websites.
Strategy

A great tool for analyzing websites.


A great tool for analyzing websites.

I found this tool that lets you see what technologies a website uses. It is similar to builtwith.com

you can use it as an browser extension.

This is what stackoverflow uses:

https://preview.redd.it/5jbrb0btjey41.png?width=541&format=png&auto=webp&s=5ce2f6ff56153fad9fa0273a7d0c29d0a0f4d4ff

submitted by /u/hiccupq
[comments]



Source link

Accepting Payments (including Recurring Payments) on WordPre...
Strategy

Accepting Payments (including Recurring Payments) on WordPre…


I’m a fan of building websites with the least amount of technical debt and things you have to be responsible for as possible for what you wanna do. Sometimes you take on this debt on purpose because you have to, but when you don’t, please don’t ;).

Let’s say you need to build a site that can take money from customers, but on a recurring basis. WordPress.com can do that now, and it’s a fantastic choice because it’s all of the power and control and none of the debt.

Here’s my thinking…

1) WordPress.com is the fastest way to spin up a WordPress site.

Not only is it fast, but you don’t have to worry about anything. Servers, SSL, security, performance, accessibility… that’s all handled for you and you can focus on what you do best. Even if you’re a seasoned developer, I’m sure you can understand how this is compelling. Automating work is what the best developers do.

2) WordPress.com sites can be eCommerce sites.

Not only sell-a-product style sites, but also recurring payments sites. Meaning you can very easily set up a subscription service, membership site, or site for monthly donations.

The pricing is like this:

WordPress.com Plan Jetpack plan Related Fees
WordPress.com eCommerce  — None
WordPress.com Business Jetpack Professional 2%
WordPress.com Premium Jetpack Premium 4%
WordPress.com Personal Jetpack Personal  8%

So you do the math and figure out the most economical plan for you. That eCommerce plan on WordPress.com is only $45/month and means zero additional fees, so I imagine once you’re up and running and making sales, that plan becomes the obvious choice.

Ideas!

  • You build custom weekly meal plans for families and charge monthly for that.
  • You have a membership site for physical training videos where people have to be a member to see the videos.
  • Your site is has a bunch of completely free great content, and you offer a way to give yearly donations to support it.

Why roll your own eCommerce when you don’t have to?

3) It used to be that your WordPress site was a bit limited on WordPress.com, but those days are over.

eCommerce is one aspect of that, but I’m talking full SFTP and database access. You can build custom themes, use your own plugins, just like any other WordPress site. So if you’re thinking that you’re giving up too much control by going with WordPress.com, make sure to re-evaluate that.


So knowing all that, I’d say you really should give WordPress.com a hard look when you’re about to spin up an eCommerce site. I’ve seen far too much over-engineering and mountains of technical debt in my life, I’d rather see people use simpler tools and get started doing their actual business, especially to start.



Source link

Post image
Strategy

Need help finding a memory leak in my video streaming route….


So I have a route on express that serves up video, I simplified the route as much as possible, but for some reason there appears to be a memory leak when using Ubuntu.

Demo: https://github.com/subnub/video-streaming-test-no-encryption

Post image

Notice All The Spawned Node Instances Using 51%

Usually the RAM will sit at about ~250, none of my other routes have this issue, and it seems to be specific to Linux/Ubuntu (my VPS is on Ubuntu 18.04), because on my Mac the memory always goes back down, and I did a heap size check, and it always returned around 30mb on my Mac. I only have a VPS on digitalocean and I cannot figure out how to get the debugging working from there. But as you can see the ram will steadily go up, and it won’t seem to ever go back down. Eventually I will get a RAM allocation error if I let the video stream long enough.

It’s worth noting that the demo only comes with a 5MB video, I recommend using at least a 200mb video if you’d wish to try this, just add any video to the root of the project, and rename it too ‘bunny.mp4’. Also you will notice in my code I attempt to kill the route if its rerequested (things like users scrubbing can cause way to many streams to be running at once, so I kill the old streams if a new one is spawned). But even If i remove this logic the memory issue still remains regardless.



Source link

Screen grab of scrolling a page while the percentage in the title updates
Strategy

How I put the scroll percentage in the title bar


Scroll down!

 

 

 

I mean it! Just scroll!

 

 

 

 

 

 

And then look up. A bit further. Yes, to the area of your tab bar where the <title> content ends up. And then scroll again.

There’s a percentage there. And it changes when you are scrolling. Kinda cool isn‘t it? Now you can tab away from this site and still have a sense of how far you have read. That surely makes your existence a tad more pleasant, doesn‘t it?

The idea to put the scroll percentage in the title bar came from this tweet by @round.

@round’s tweet

I didn’t make a browser extension, rather, I just put the mechanics into my own blog post template. Since I’m on Gatsby and React, it was not that hard. Here’s how to do it:

First I installed the react-scroll-percentage package. That takes care of most of the heavy lifting. Then, and I’m honestly feel a bit out of depth here, I thought it made sense to put the actual mechanics into useEffect. It may be that it would have been possible to make Gatsby and React rerender the <title> part in another way, but I was just following my gut here (tell me on Twitter if there‘s a better way). So I ended up with something like this (actual code here):

import React, {useEffect} from 'react'
import {useScrollPercentage} from 'react-scroll-percentage'
import Container from '../components/container'
import BlogPost from '../components/blog-post'
import SEO from '../components/seo'
import Layout from '../containers/layout'
import {toPlainText} from '../lib/helpers'

const BlogPost = ({post}) => {
  const {title, _rawExcerpt} = post
  const [ref, percentage] = useScrollPercentage()
  
  useEffect(() => {
    if (post) {
      const percent = Math.round(percentage * 100)
      document.title = `${percent}% ${post.title}`
    }
  }, [percentage])
  
  return (
    <Layout>
      {post && <SEO title={` ${title}` || 'Untitled'} description={toPlainText(_rawExcerpt || [])} />}

      <div ref={ref}>
        {post && <BlogPost {...post} />}
      </div>
    </Layout>
  )
}

export default BlogPost

Since react-scoll-percentage uses Intersection Observer, which is a relatively new browser API, we also need a polyfill for browsers that doesn’t support it yet. First install it as a dependency.

npm i intersection-observer

Then we want Gatsby only to use the polyfill in the browser, and import it dynamically when it‘s needed. We’ll do that by inserting this into gatsby-browser.js:

// gatsby-browser.js

export const onClientEntry = async () => {
  if (typeof IntersectionObserver === `undefined`) {
    await import(`intersection-observer`);
  }
}

And that’s it! Now, marvel at your new updating reading lenght!

Screen grab of scrolling a page while the percentage in the title updates
Most fun on long posts





Source link

My first completed piece of work
Strategy

My first completed piece of work


My first completed piece of work

I have approximately zero experience with graphic design an art in general so I started with something relatively simple using Autodesk Sketchbook. I love the game, I love the humor, and I figured it fits with the times we live in. Going to make it into bumper stickers for me and my friends. What do you think? Any suggestions for improving my skills or exercises to practice etc.

https://preview.redd.it/2kmld789vby41.jpg?width=474&format=pjpg&auto=webp&s=e8fc8ec5626ee93532f749952724b09ee0fcf2ec

submitted by /u/r_smith6699
[comments]



Source link

Post image
Strategy

Help me choose a logo for a restaurant : graphic_design


Post image

1.

Post image

2.

Post image

3.

Post image

4.

Hey guys,

so my aunt is a chef and is going to start cooking Filipino dishes (as well as other types of dishes) and deliver the food to people’s houses and they can also pick it up from her home. She needs a logo for her business and I’ve offered to make one for her but I need your help. I can’t decide Which I like the most or if I even like any. Please be as honest as you can and tell me what you would change and what to keep. also please tell me which you like the most. The business is called Marmies and she’s based in an island in the Philippines called Siargao. I’ve marked each design with a number so you can easily tell me your thoughts on each on or the ones you want to critique.
thank you so much.

info about her business:

– a take away/ delivery food service with food fresh from our farm such as filipino sausages, udon noodles etc.

– food made by a professional chef who has worked in countries like New Zealand and The Philippines

– Filipino dishes as well as dishes From around the world

– name of the business: Marmies

//Maria



Source link

Сar alarm remote for ZAZ 965 (Fiat 600)
Strategy

Сar alarm remote for ZAZ 965 (Fiat 600)


Сar alarm remote for ZAZ 965 (Fiat 600)

Hello!
Сoncept of a car alarm remote control for ZAZ Zaporozhets (or Fiat 600, whatever suits you best), as if the similar devices already existed in those days.

https://preview.redd.it/dkfemlircay41.png?width=1400&format=png&auto=webp&s=fbbe54015f1819d0a1360dd5d97dfd0dc037ba28

submitted by /u/Salt-Army
[comments]



Source link

A horizontal timeline showing the animation of the Background, Heading, Description, and Button.
Strategy

CSS Animation Timelines: Building a Rube Goldberg Machine


Multi-stage animations can help bring websites to life, but they can be difficult to write and maintain in CSS. Because of this, heavy JavaScript libraries are often added to make creating these animations easier. Lately I’ve been using custom properties to plan out pure CSS timelines for complex animations.

I often use these sorts of animation sequences for showing hidden content. In the example below, the background, heading, description and button fade in and slide down in sequence:

Each element needs to perform its transition at a precise time in relation to the its siblings. In the past I would’ve written the CSS for this animation sequence like this:

.section {
  transition-duration: 0.1s;
  /* ... Other Section CSS ... */
}

.section__title {
  transition-duration: 0.2s;
  transition-delay: 0.1s;
  /* ... Other Title CSS ... */
}

.section__description {
  transition-duration: 0.2s;
  transition-delay: 0.3s;
  /* ... Other Description CSS ... */
}

.section__button {
  transition-duration: 0.2s;
  transition-delay: 0.5s;
  /* ... Other Button CSS ... */
}

.section.is-open {
  /* Change CSS values to trigger a transition */
}

.section.is-open .section__title,
.section.is-open .section__description,
.section.is-open .section__button {
  /* Change CSS values to trigger a transition */
}

This example has been simplified to focus on only the relevant CSS.

There are a few issues with this code that makes it difficult to read and update:

  1. It specifies that the heading transition starts after 0.1 seconds. But what I really want is to specify that the heading transition starts after the background transition ends.
  2. If we change the speed of one animation step, we’ll need to manually update the timing of the rest of the sequence.
  3. Our transition delays and durations are mixed in with our styling CSS, making it more difficult to scan and understand the sequence of animations.
A horizontal timeline showing the animation of the Background, Heading, Description, and Button.

Let’s step back and reconsider our approach by visualizing a timeline of the animation sequence we’re creating. First the background (BG) animates, then the heading, then the description, and finally the button.

Using variables, we can write CSS to match the timeline above and solve all three of the issues with our previous code.

  1. Transition delays are defined relative to previous animation steps instead of being set to specific times.
  2. Since each transition delay is relative to the previous animation step’s timing, changing one step’s speed updates the whole sequence.
  3. The CSS for our timeline is all in one place instead of scattered throughout our CSS file.

Here’s an example of how we could achieve this in CSS. (The examples in this article are using CSS custom properties, but the same technique could be achieved using SASS or LESS variables if you need to support IE11.)

First, let’s set the duration of each step of our animation:

:root {
  --background-duration: 0.1s;
  --title-duration: 0.2s;
  --description-duration: 0.2s;
  --button-duration: 0.2s;
}

Next, we calculate when each animation step should begin (their transition-delays). We can do this by adding the previous animation step’s start time and duration. This gives us the time that the previous animation step ended:

:root {
  --background-delay: 0s;
  --title-delay: calc(
    var(--background-delay) + var(--background-duration)
  );
  --description-delay: calc(
    var(--title-delay) + var(--title-duration)
  );
  --button-delay: calc(
    var(--description-delay) + var(--description-duration)
  );
}

Finally, we can reference those properties to set the transition timing of our elements:

.section {
  transition-duration: var(--background-duration);
  /* ... Other Section CSS ... */
}

.section__title {
  transition-duration: var(--title-duration);
  transition-delay: var(--title-delay);
  /* ... Other Title CSS ... */
}

.section__description {
  transition-duration:  var(--description-duration);
  transition-delay: var(--description-delay);
  /* ... Other Description CSS ... */
}

.section__button {
  transition-duration:var(--button-duration);
  transition-delay: var(--button-delay);
  /* ... Other Button CSS ... */
}

This technique makes it easier to understand and change the animation timeline. Changing the speed of one transition automatically ripples throughout the whole animation sequence without any manual work.

I find this a lot easier to work with, but there’s still a problem: it’s difficult to change the overall speed of the animation sequence. If I decide the whole sequence should be faster or slower, I’ll need to change the speed of each animated element.

By making all of the durations relative to a --base-speed variable, we can easily speed up or slow down the whole sequence. This also simplifies debugging, since you can view the sequence in slow motion by changing one value.

:root {
  --base-speed: 0.2s;

  --background-duration: calc(var(--base-speed) / 2);
  --title-duration: var(--base-speed);
  --description-duration: var(--base-speed);
  --button-duration: var(--base-speed);
}

I added some sliders to the animation so you can control the CSS timeline by updating the base speed or individual elements’ relative speeds. (Move the sliders to the right to slow things down.)

Building a Rube Goldberg Machine


This technique can be scaled up to build some truly complex animations. I decided to build a CSS and SVG Rube Goldberg machine to put it to the test:

I built this animation using SVG imagery, but the underlying strategy remains the same. Each element’s delay is calculated by adding the previous animation’s start time and duration. For this more complicated example I had to use a few new tricks:

  1. In some cases I wanted the next animation step to start slightly before the previous step ended. In that case I multiplied the previous duration by a fraction or decimal.
  2. I used CSS keyframe animations in addition to transitions. These were timed using animation-delay and animation-duration.
  3. When the SVG is wider than the viewport, I added a horizontal panning transition to the entire SVG. I used the duration of all animation steps added together to make sure this was timed correctly.

Here’s what this CSS timeline ended up looking like:

:root {
  --base-speed: 0.5s;

  --domino-speed: calc(var(--base-speed) * 1.5);
  /**
   * Dominos hit the next domino before finishing their 
   * transition. We start the next domino's transition 
   * when they actually hit.
   */
  --domino-hit-speed: calc(var(--domino-speed) * 0.25);
  /**
   * The final domino falls all the way down instead of 
   * resting on another domino. Since it has further to 
   * go, its duration lasts longer so it appears to be 
   * going the same speed.
   */
  --last-domino-speed: calc(var(--domino-speed) * 10 / 9);

  --domino-1-delay: 0s;
  --domino-2-delay: 
    calc(var(--domino-1-delay) + var(--domino-hit-speed));
  --domino-3-delay: 
    calc(var(--domino-2-delay) + var(--domino-hit-speed));
  --domino-4-delay: 
    calc(var(--domino-3-delay) + var(--domino-hit-speed));
  --domino-5-delay: 
    calc(var(--domino-4-delay) + var(--domino-hit-speed));
  --domino-6-delay: 
    calc(var(--domino-5-delay) + var(--domino-hit-speed));

  --ball-and-string-speed: calc(var(--base-speed) * 2);
  --ball-and-string-delay: calc(
    var(--domino-6-delay) + var(--domino-speed) * 0.2
  );

  --car-speed: calc(var(--base-speed) * 4);
  --car-delay: calc(
    var(--ball-and-string-delay) + 
    var(--ball-and-string-speed) * 0.25
  );

  --_8-ball-speed: calc(var(--base-speed) * 5);
  --_8-ball-delay: 
    calc(var(--car-delay) + var(--car-speed) * 0.9);

  --domino-7-delay: 
    calc(var(--_8-ball-delay) + var(--_8-ball-speed) * 0.9);
  --domino-8-delay: 
    calc(var(--domino-7-delay) + var(--domino-hit-speed));
  --domino-9-delay: 
    calc(var(--domino-8-delay) + var(--domino-hit-speed));
  --domino-10-delay: 
    calc(var(--domino-9-delay) + var(--domino-hit-speed));
  --domino-11-delay: 
    calc(var(--domino-10-delay) + var(--domino-hit-speed));
  --domino-12-delay: 
    calc(var(--domino-11-delay) + var(--domino-hit-speed));

  --last-ball-speed: calc(var(--base-speed) * 3);
  --last-ball-delay: 
    calc(var(--domino-12-delay) + var(--domino-hit-speed));

  --total-duration: 
    calc(var(--last-ball-delay) + var(--last-ball-speed));
}

Once again, I’ve separated out the animation timeline from the rest of the styles, allowing me to change the timeline without digging through a bunch of other CSS rules.

This complex animation sequence was built entirely with CSS. All it takes to play the entire sequence is toggling a single class!

I’ve just started experimenting with this technique and I’m excited to keep exploring the possibilities and building more animations on the web!



Source link