Skip to content

Instantly share code, notes, and snippets.

View amaurycatelan's full-sized avatar
🌻
what's up, doc?

Amaury Catelan amaurycatelan

🌻
what's up, doc?
View GitHub Profile
@jq2
jq2 / gist:1c3771d581015648c807d2abebc989e6
Last active January 4, 2021 03:53
Lista de canais com cursos e/ou vídeo aulas sobre computação (Português pt_BR).
Code Shadow
https://www.youtube.com/c/CodeShadow
DevDojo
https://www.youtube.com/channel/UCjF0OccBT05WxsJb2zNkL4g/playlists
Tutorial Python - Abel Separovich
https://www.youtube.com/user/Oseparovich/playlists
@kdby-io
kdby-io / graphql-typescript-typeorm.ts
Last active July 3, 2018 03:50
An example for graphql-typescript with typeorm
import { Entity, Column, PrimaryGeneratedColumn, getRepository, CreateDateColumn, UpdateDateColumn } from 'typeorm'
import { Type, Field, ID, String, Mutation } from 'graphql-typescript'
class CreateUserArguments {
@Field(String) username: string
@Field(String) password: string
}
@Entity({ name: 'User' })
@Type
@ashfame
ashfame / deploy-all-lambdas.sh
Last active February 25, 2018 18:27
Bash script to deploy lambdas to all regions using Up - https://blog.ashfame.com/?p=1288
#!/usr/bin/env bash
declare -a regions=(
us-east-2 #US East (Ohio)
us-east-1 #US East (N. Virginia)
us-west-1 #US West (N. California)
us-west-2 #US West (Oregon)
ap-northeast-1 #Asia Pacific (Tokyo)
ap-northeast-2 #Asia Pacific (Seoul)
ap-south-1 #Asia Pacific (Mumbai)
@MeFoDy
MeFoDy / css_secrets_trigonometry.md
Last active May 3, 2020 23:50
Trigonometry usage in CSS Secrets by Lea Verou
anonymous
anonymous / gist:da39eeadddb488c39c1263975538ffc5
Created February 4, 2018 05:48
Water Version 3
#Basic equasion, I do it this way to increase reliablity because I trust JavaScript's date parsing more than writing a regex against nightbot.
$(eval Math.trunc((Date.now()- Date.parse('$(twitch mellana "{{uptimeAt}}")'))/(1000*60*60));)
#Version 1, repeats the math multiple times
@mellana You've been live for just over $(eval Math.trunc((Date.now()- Date.parse('$(twitch mellana "{{uptimeAt}}")'))/(1000*60*60));) hours. By this point in your broadcast you should have consumed at least $(eval 4*Math.trunc((Date.now()- Date.parse('$(twitch mellana "{{uptimeAt}}")'))/(1000*60*60));)oz ($(eval 120*Math.trunc((Date.now()- Date.parse('$(twitch mellana "{{uptimeAt}}")'))/(1000*60*60));)mL) of water to maintain optimum hydration.
#Version 2, builds string in Javascript, but only does math once!
$(eval const hours = Math.trunc((Date.now()- Date.parse('$(twitch mellana "{{uptimeAt}}")'))/(1000*60*60)); "@mellana You've been live for just over " + hours + " hours. By this point in your broadcast you should have consum
@mort3za
mort3za / git-auto-sign-commits.sh
Last active February 5, 2025 18:58
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@luciopaiva
luciopaiva / _Full-socketio-client-and-server-example.md
Last active January 24, 2025 14:53
Full socket.io client and server example

Full socket.io client and server example

Last updated: 2021-02-21, tested with socket.io v3.1.1

This is the simplest implementation you will find for a client/server WebSockets architecture using socket.io.

To see a full explanation, read my answer on SO here: https://stackoverflow.com/a/24232050/778272.

If you're looking for examples using frameworks, check these links:

@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active July 13, 2024 16:51
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@katopz
katopz / ts-dl.sh
Created August 16, 2017 15:49
Download .ts video file by ffmpeg via .m3u8
# Install ffmpeg
brew install ffmpeg
# Download
ffmpeg -i https://foo.com/bar.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4