Skip to content

Instantly share code, notes, and snippets.

@Timopheym
Timopheym / sync_pins.js
Last active September 9, 2023 17:09
Small script to download your pinterest boards to your machine. Limit 50 pins per board... but you can download all pins from board using instruction inside ;)
var request = require("request");
var fs = require("fs");
var api_root = 'http://widgets.pinterest.com/v3/pidgets/boards/';
var sync_dir = './images', image_url, image_path, current_user_boards, current_user_name, board_dir;
var users = {
timopheym : [
'skatches',
'home',
@squarism
squarism / iterm2.md
Last active May 3, 2024 08:58
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@domenic
domenic / angularpromise.js
Created January 21, 2016 23:28
How to subclass a promise
// ES6
class AngularPromise extends Promise {
constructor(executor) {
super((resolve, reject) => {
// before
return executor(resolve, reject);
});
// after
}
@miroslavtamas
miroslavtamas / install-apache-maven-3.3.9.sh
Created April 22, 2016 10:48
Install Apache Maven 3.3.9 on CentOS
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
mkdir /usr/local/maven
mv apache-maven-3.3.9/ /usr/local/maven/
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
alternatives --config mvn
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bdpwebdesign
bdpwebdesign / key_mapping.md
Last active November 29, 2023 15:59
Apple Magic Keyboard mapping for Linux Mint

Map an Apple Magic Keyboard to a Linux machine

Configured for a Mac-like experience

Apple Magic Keyboard 2: Model A1644 (same as MLA22LL/A ?)

Mapping for Linux Mint 18 Cinnamon 64-bit

xmodmap source

@cheungnj
cheungnj / script.sh
Last active March 6, 2024 02:35
Convert asciidoc to Github Flavored Markdown
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active January 29, 2024 06:11
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
@gibatronic
gibatronic / README.md
Last active January 25, 2024 21:46
Tab completion for the npx command

complete_npx

Bash tab completion for the npx command

Usage

Save complete_npx in your home folder and then source it on your .bash_profile with:

. ~/complete_npx.sh
@bcnzer
bcnzer / postman-pre-request.js
Last active April 30, 2024 21:20
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',