Skip to content

Instantly share code, notes, and snippets.

@SamL98
SamL98 / get_recents.py
Last active May 15, 2024 18:18
Python Script for Getting Spotify Listening History
# To run as a local cron job, edit your crontab like so:
#
# SPOTIPY_USER_ID=<redacted>
# SPOTIPY_CLIENT_ID=<redacted>
# SPOTIPY_CLIENT_SECRET=<redacted>
# script_path=<redacted>
# SPPATH=$script_path
# python_path=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
#
# PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@perkinslr
perkinslr / regexfind.py
Created July 24, 2018 02:17
Regex Specificity Matcher
import re
def _exapnd_regex(a, p, out_strings):
one = False
last = 0
d = p.finditer(a)
for e in d:
one = True
grp = e.group()
@crock
crock / RangeSlider.js
Last active May 15, 2024 18:14
Multi-handle range slider input (HTML5 Web Component)
import { polyfillDeclarativeShadowDom } from "./pollyfill";
/**
* Multi-handle range slider input Web Component
* @class RangeSlider
* @extends HTMLElement
* @property {number} min - Minimum value of the slider
* @property {number} max - Maximum value of the slider
* @property {number} step - Step value of the slider
* @property {number[]} values - Array of values for each handle
@abul4fia
abul4fia / ligth_theme.py
Last active May 15, 2024 18:13
Light theme for manim
# Put this file in the same folder than your manim script
# and start your script with:
#
# import light_theme
from manim import *
config.background_color = WHITE
# Those are objects which are WHITE by default

Comment utiliser Matomo sans bannière de consentement

  1. permettre aux visiteurs de refuser d’être suivis (Opt-out) (exemple)
  2. désactiver les cookies + s’assurer qu’on ne track pas de données personnelles dans Matomo (même sans cookie)
  3. anonymiser les IP : anonymiser au moins 2 octets via l’admin de Matomo
  4. anonymiser le référent via l’admin de Matomo
  5. exclure les données personnelles des URL et titre des pages
  6. exclure les données personnelles des variables personnalisées, dimensions, évènements (usage avancé)
  7. masquer les données personnelles dans les heatmaps et les enregistrements d’écran (usage avancé)
  8. exclure les identifiants de commande de commerce électronique (usage avancé)
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 15, 2024 18:11
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active May 15, 2024 18:06
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@mindplace
mindplace / git_and_github_instructions.md
Last active May 15, 2024 18:05
Pushing your first project to github

1. Make sure git is tracking your project locally

Do you need a refresher on git? Go through Codecademy's git course.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase. → You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.
    → Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  2. Check if git is already initialized: git status