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
@patik
patik / .bashrc
Last active Aug 15, 2019
Bash configure proxy for corporate network
View .bashrc
# configure proxy for git while on corporate network
# From https://gist.github.com/garystafford/8196920
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
@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
@patik
patik / how-to-squash-commits-in-git.md
Last active Aug 4, 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:

@patik
patik / styles.css
Last active Jul 23, 2019 — forked from joshbode/numbered_headings.md
Numbered Headings in Markdown via CSS
View styles.css
h1 { counter-reset: h2counter; }
h2 { counter-reset: h3counter; }
h3 { counter-reset: h4counter; }
h4 { counter-reset: h5counter; }
h5 { counter-reset: h6counter; }
h6 {}
h2:before {
counter-increment: h2counter;
content: counter(h2counter) ".\0000a0\0000a0";
View osx-special-chars.ahk
#UseHook
!VKC0SC029::Return ; grave -> the grave ` accent gave some probs, used the virtualkey + scancode instead
!e::Return ; acute
!i::Return ; circumflex
!t::Return ; tilde
!u::Return ; umlaut
; 1 2 3 4 5 6 7 8 9 1
; 0
; r g G a A c C t T u U
@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
@patik
patik / format-commas.js
Last active Nov 7, 2016
Format number with commas
View format-commas.js
// Converts `1234567` => `"1,234,567"
// Does not support decimals yet
function formatNumberWithCommas (number) {
return ('' + number) // Convert to a string
.split('').reverse().join('') // Reverse the order of the characters (which are all digits at this point)
.replace(/(...)/g, '$1,') // Insert a comma after every three digits
.split('').reverse().join('') // Un-reverse the characters
.replace(/^,/, ''); // Remove any commas that were added to the beginning (i.e. if the number of digits was a multiple of three)
};
View file.html
<!DOCTYPE html>
<html lang="en">
<head>
<script>
window.ts_endpoint_url = "https:\/\/slack.com\/beacon\/timing";
(function(e) {
var n = Date.now ? Date.now() : +new Date,
r = e.performance || {},
@patik
patik / magnet-links.user.js
Created Jan 12, 2014
Displays magnet links and other P2P URLs prominently. Great for sites that hide the real links between obnoxious "download" ad banners or open pop ups when you click on them.
View magnet-links.user.js
@patik
patik / app.css
Last active Dec 22, 2015
Transition height/width to `auto` by defining the transition in CSS
View app.css
.expandable {
transition-property: none;
transition-duration: .5s;
transition-timing-function: ease-in-out;
}
/* Vary the transition with different classes */
.expandable.molasses {
transition-duration: 3s;
}
You can’t perform that action at this time.