Skip to content

Instantly share code, notes, and snippets.

View ErikFontanel's full-sized avatar

Erik Gelderblom ErikFontanel

View GitHub Profile
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@peterdemartini
peterdemartini / command.sh
Last active April 28, 2024 02:42
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@fabrizim
fabrizim / acf-customizer-patch.php
Last active January 17, 2024 02:30
Plugin to allow for Advanced Custom Fields to be used in widgets within the Customizer
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch
@zakhardage
zakhardage / Tiered Pricing for Shopify
Last active April 19, 2022 10:53
Shopify tiered pricing using javascript (non-app). This example has the quantity breaks controlled by theme settings.
// config -> settings.html
// Make sure you have the same number of quantity breaks as product variants
<fieldset>
<legend>Quantity Breaks</legend>
<table class="standard-table">
<tr><td>Enter quantity breaks in ascending order separated by a comma (e.g. 5, 10, 20, 50)</td><td><input type="text" name="breaks" size="50" /></td></tr>
</table>
</fieldset>
@karlwestin
karlwestin / .gitconfig
Created May 23, 2011 13:34
Make git diff ignore whitespace and don't try to open jpgs and shit
# this can be put in [repo]/.git/config for local settings
# or ~/.gitconfig for global settings
# create a difftool "nodiff" that just returns true
# this path is for Mac. On linux it's /bin/true i guess
[diff "nodiff"]
command = /usr/bin/true
# make git ignore white space differences, many different possibilites here
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
@elomagic
elomagic / timemachine-install.sh
Last active May 1, 2020 18:14
Script for installing a Time Machine server
#!/bin/bash
#title : timemachine-install.sh
#description : Script for installing a Time Machine server.
#more : http://www.elomagic.de
#author : Carsten Rambow
#date : 2016-12-02
#usage : /bin/bash timemachine-install.sh
#tested-distros : Ubuntu Server 16.10, Raspbian (Based on Debian)
TIMEMACHINE_USER="timemachine"
@numtel
numtel / ec2-rai-node.md
Last active May 12, 2019 22:18
Install rai_node on EC2 Ubuntu instance

Follow these instructions to start an EC2 instance running Ubuntu that will run rai_node on startup

  1. Select Ubuntu Server 16.04 LTS (HVM), SSD Volume Type. A t2.small or larger instance type is recommended.

  2. Configure the security group to match the screenshot.

  3. Download install_rai_node.sh below, update the URLs with their latest versions.

    Get latest rai_node archive URL from https://github.com/clemahieu/raiblocks/releases.

    Get latest gdrive-linux-x64 version URL from https://github.com/prasmussen/gdrive#downloads