Skip to content

Instantly share code, notes, and snippets.

@joshbode
joshbode / numbered_headings.md
Last active April 3, 2020 07:46
Numbered Headings in Markdown via CSS

World

Country

State

City

Suburb
Street
<style type="text/css"> body { margin: auto;
@garystafford
garystafford / git_proxy_functions_v2.sh
Last active January 29, 2020 03:42
v2 of Gist for blog post 'Revised Configuration of Git for Windows on a Corporate Network with Vagrant'. Easily turn proxy-related settings on and off for Git for Windows. 1) Add these functions to your ~\.bashrc file, 2) Change PROXY_SERVER, and PORT default values, 3) Open new Git Bash interactive shell window and execute function before using…
# configure proxy for git while on corporate network
function proxy_on(){
# assumes $USERDOMAIN, $USERNAME, $USERDNSDOMAIN
# are existing Windows system-level environment variables
# assumes $PASSWORD, $PROXY_SERVER, $PROXY_PORT
# are existing Windows current user-level environment variables (your user)
# environment variables are UPPERCASE even in git bash
@RReverser
RReverser / better-console-log.js
Last active May 9, 2019 21:07
Better console.log in Node
// UPD:
// Now available as npm module!
// Check out https://github.com/RReverser/better-log for details.
console.log = (function (log, inspect) {
return function () {
return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
return inspect(arg, { depth: 1, colors: true });
}));
};
@esteinborn
esteinborn / pptpVPNreconnect
Created February 11, 2016 02:55
REconnect PPTP VPN profile for Synology
#!/bin/sh
#version 2014-04-26
VPNC_CONNECTING="/usr/syno/etc/synovpnclient/vpnc_connecting"
#get connection name
CONNECTION=`cat /usr/syno/etc/synovpnclient/pptp/pptpclient.conf | grep conf_name | awk 'BEGIN {FS="="} {print $2}'`
#get connection id
ID=`ls /usr/syno/etc/synovpnclient/pptp/ | grep options | awk 'BEGIN {FS="_"} {print $2}' | awk 'BEGIN {FS="."} {print $1}'`
@patik
patik / 1.install.md
Last active October 17, 2017 06:08
Proxy config for Git and Node at DTF

Download and install these first:

  • NodeJS
  • Git for Windows
    • During installation, on the options screen with the check boxes about what to install, check the box for TrueType fonts
    • On the screen with three radio button options about the shell and Windows Command Prompt, choose the second option
    • Go with the default options for the rest of the installation
  • SourceTree
    • This is similar to GitHub's app, but more powerful and flexible
#!/usr/bin/perl
# Convert (and delete) TES files in Wintec WBT-201 to GPX files.
use strict;
use warnings;
use File::Basename;
use Time::Piece;
@ex-nerd
ex-nerd / do_crashplan_upgrade.sh
Last active December 26, 2015 14:29
Synology Crashplan upgrade
# Fix a failed Crashplan upgrade on a Synology NAS.
# This function should be run directly on the NAS, as root.
#
# Based on Chris Nelson's blog post from here:
# http://chrisnelson.ca/2015/07/02/fixing-crashplan-4-3-0-on-synology/
function do_crashplan_upgrade() {
cp_target_dir="/var/packages/CrashPlan/target"
cp_upgrade_jar=`ls -t -1 "$cp_target_dir/upgrade/"*jar | head -n1`
cp_version=`basename "$cp_upgrade_jar" .jar`
@jpgls
jpgls / list-html-classes
Last active August 29, 2015 14:01
List All Class Names Used on Page
// Temporary code for Development
var elements = document.getElementsByTagName('*');
console.log('$$$$$ - Checked this many elements - ', elements.length);
var unique = function (list, x) {
if (x != "" && list.indexOf(x) === -1) {
list.push(x);
}
return list;
};
@JeffHerb
JeffHerb / clear all but .git
Created March 12, 2014 00:04
If you ever have the need to completely remove the contents of a git project folder, but want to retain the .git
for i in `ls | grep -v ".git"` ; do rm -rf $i; done; rm .gitignore;