Skip to content

Instantly share code, notes, and snippets.

Craig Patik patik

Block or report user

Report or block patik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@esteinborn
esteinborn / pptpVPNreconnect
Created Feb 11, 2016
REconnect PPTP VPN profile for Synology
View pptpVPNreconnect
#!/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}'`
@joshbode
joshbode / numbered_headings.md
Last active May 26, 2018
Numbered Headings in Markdown via CSS
View numbered_headings.md

World

Country

State

City

Suburb
Street
<style type="text/css"> body { margin: auto;
@ex-nerd
ex-nerd / do_crashplan_upgrade.sh
Last active Dec 26, 2015
Synology Crashplan upgrade
View do_crashplan_upgrade.sh
# 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`
@patik
patik / git-setup.sh
Created Nov 13, 2015
Git and Node with Zscaler proxy
View git-setup.sh
#!/bin/sh
# Git proxy settings
echo "Configuring Git..."
git config --global http.proxy http://gateway.zscaler.net:80/
git config --system http.proxy http://gateway.zscaler.net:80/
git config --global http.sslVerify false
git config --system http.sslVerify false
git config --global --unset http.sslcainfo
git config --system --unset http.sslcainfo
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active May 14, 2019
How to view-source of a Chrome extension
View how-to-view-source-of-chrome-extension.md

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@patik
patik / how-to-squash-commits-in-git.md
Last active May 8, 2019
How to squash commits in git
View how-to-squash-commits-in-git.md

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@RReverser
RReverser / better-console-log.js
Last active May 9, 2019
Better console.log in Node
View better-console-log.js
// 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 });
}));
};
@patik
patik / 1.install.md
Last active Oct 17, 2017
Proxy config for Git and Node at DTF
View 1.install.md

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
@jpgls
jpgls / list-html-classes
Last active Aug 29, 2015
List All Class Names Used on Page
View list-html-classes
// 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 Mar 12, 2014
If you ever have the need to completely remove the contents of a git project folder, but want to retain the .git
View clear all but .git
for i in `ls | grep -v ".git"` ; do rm -rf $i; done; rm .gitignore;
You can’t perform that action at this time.