Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tobias Hochgürtel tobiashochguertel

🎯
Focusing
View GitHub Profile
@Timopheym
Timopheym / sync_pins.js
Last active Nov 25, 2020
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 ;)
View sync_pins.js
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',
@rafaeltuelho
rafaeltuelho / install-gosu-centos.md
Last active Dec 2, 2020
installing gosu on a centos docker box
View install-gosu-centos.md
# Install gosu.  https://github.com/tianon/gosu
ENV GOSU_VERSION=1.11
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
    && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" \
    && gpg --verify /usr/local/bin/gosu.asc \
    && rm /usr/local/bin/gosu.asc \
    && rm -r /root/.gnupg/ \
    && chmod +x /usr/local/bin/gosu \
@domenic
domenic / angularpromise.js
Created Jan 21, 2016
How to subclass a promise
View angularpromise.js
// ES6
class AngularPromise extends Promise {
constructor(executor) {
super((resolve, reject) => {
// before
return executor(resolve, reject);
});
// after
}
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active Dec 12, 2020
Ubuntu for Windows: Mounting C: Drive to WSL's Root
View persistent_c_mount_wsl.sh
# 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
@DominicTobias
DominicTobias / conduit.connect.js
Last active Dec 13, 2020
Connect to Phabricator with node.js
View conduit.connect.js
var Connect = function() {
this.fs = require('fs');
this.crypto = require('crypto');
this.http = require('http');
this.url = require('url');
this.q = require('q');
this.initialize();
};
@BlakeGardner
BlakeGardner / install nano.sh
Last active Dec 18, 2020
Syntax highlighting in nano on Mac OS
View install nano.sh
# install Homebrew if you don't already have it: http://mxcl.github.io/homebrew/
# install nano from homebrew
brew install nano
# update your nanorc file with the contents of the nanorc file below
nano ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@suhlig
suhlig / install-tmux
Last active Dec 23, 2020 — forked from philipsd6/install-tmux
Install tmux on rhel/centos
View install-tmux
# Install tmux on rhel/centos 7
# What do we want?
libeventversion=2.1.11
tmuxversion=3.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
View colortab.sh
#!/bin/bash
# Credits to https://gist.github.com/phette23/5270658 for inspiration
# https://superuser.com/a/599156
function setTabname {
echo -ne "\033]0;"$*"\007"
}
# set the title using above declared function and set the color of
@mrchief
mrchief / LICENSE.md
Last active Dec 28, 2020
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)
View LICENSE.md

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@welbornprod
welbornprod / Embedded Python in BASH
Created Aug 14, 2014
A little trick to embed python code in a BASH script.
View Embedded Python in BASH
#!/bin/bash
# Here are some embedded Python examples using Python3.
# They are put into functions for separation and clarity.
# Simple usage, only using python to print the date.
# This is not really a good example, because the `date`
# command works just as well.
function date_time {
You can’t perform that action at this time.