ANSI escape sequences can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.
A great article about it can be found here.
// make sure you have changed your working directory to your project | |
cd app | |
// svelte | |
// see https://github.com/sveltejs/svelte/issues/2900#issuecomment-701644971 | |
npm install svelte | |
sed -i 's/svelte-\$/_$/g' ./node_modules/svelte/compiler.js | |
// sapper | |
npm install sapper |
ANSI escape sequences can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.
A great article about it can be found here.
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
float decel(float x) { // as an easing function | |
return 1-(x-1)*(x-1); | |
} | |
void setup() { | |
background(255); | |
size(750,750,P2D); | |
PImage img = loadImage("image.png"); | |
strokeWeight(2); | |
noFill(); |
#!/usr/bin/env bash | |
PATH=/home/fracz/.nvm/versions/node/v12.13.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
cd "$(dirname "$0")" | |
# npm install -g capture-website-cli | |
capture-website 'https://zoom.earth/#view=38,23.4,4z' --output wallpaper.png --hide-elements='.cookies, .panel, .locate, .help, .attribution, button, .settings' --overwrite --script='setTimeout(function() { document.getElementById("menu-terminator").click(); document.getElementById("menu-radar").click(); document.getElementById("menu-storm-tracks").click(); document.getElementById("menu-labels").click(); }, 1000)' --delay=2 --width=1920 --height=1000 && \ | |
gsettings set org.gnome.desktop.background picture-uri file://$(pwd)/wallpaper.png |
With 2^0 = 1 bit signed integers, Unix time will overflow on: 00:00:01 UTC January 01, 1970 | |
With 2^0 = 1 bit unsigned integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970 | |
With 2^1 = 2 bit signed integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970 | |
With 2^1 = 2 bit unsigned integers, Unix time will overflow on: 00:00:04 UTC January 01, 1970 | |
With 2^2 = 4 bit signed integers, Unix time will overflow on: 00:00:08 UTC January 01, 1970 | |
With 2^2 = 4 bit unsigned integers, Unix time will overflow on: 00:00:16 UTC January 01, 1970 | |
With 2^3 = 8 bit signed integers, Unix time will overflow on: 00:02:08 UTC January 01, 1970 |
''' | |
Check if user in github follow you back or not | |
''' | |
import requests | |
username = input("Enter your username: ") | |
def main(username): |
WITH double_entry_book AS ( | |
-- debits | |
SELECT | |
array_to_string(inputs.addresses, ",") as address | |
, inputs.type | |
, -inputs.value as value | |
, block_timestamp | |
FROM `bigquery-public-data.crypto_bitcoin.inputs` as inputs | |
UNION ALL |
See how a minor change to your commit message style can make a difference.
Tip
Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.
But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.
Svelte is a language.
Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?
A few projects that have answered this question: