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 / 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
View Duplicate-ID-Finder.markdown

Duplicate ID Finder

Reports IDs that are being used by multiple elements within a page, including the number of occurrences of each one

A Pen by Craig Patik on CodePen.


patik /
Last active Aug 29, 2015
Why you can't rely on JavaScript

Some of these articles may be old but their arguments hold true. In particular, with more and more people relying on flaky, high-latency cellular networks to deliver sites there is possibly even more concern that JS may not work, even in an otherwise capable browser.

patik / _breakpoint.scss
Last active Aug 29, 2015
Breakpoint without Compass
View _breakpoint.scss
@mixin breakpoint($size: "", $maxWidth: false) {
@if $size == "" {
$size: 20em; // Put your "main" or most-used breakpoint here to use it as a default
// Default, `min-width` media query
@if $maxWidth == false {
@media (min-width: $size) { @content; }
// Alternative `max-width` media query
patik / data.js
Created Jun 18, 2014
Simple JSON path parser
View data.js
// Source data (JSON) from the server
data = {
abc: {
def: {
ghi: 'jkl'
// The path you're looking for (you want the value of `ghi`)
patik / .bashrc
Last active Aug 15, 2019
Bash configure proxy for corporate network
View .bashrc
# configure proxy for git while on corporate network
# From
function proxy_on(){
# are existing Windows system-level environment variables
# are existing Windows current user-level environment variables (your user)
# environment variables are UPPERCASE even in git bash
patik /
Last active Oct 17, 2017
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
patik /
Last active Aug 22, 2019
How to squash commits in git

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 /
Last active Sep 14, 2015
Popover plugin specifications



The popover plugin displays HTML in a container that overlays the page. It is triggered by clicking on a button or other UI element and the container is positioned near the element. The popover can be displayed and hidden at will.


The plugin must be provided with an options object and a jQuery collection of elements.

patik /
Created Nov 13, 2015
Git and Node with Zscaler proxy
# Git proxy settings
echo "Configuring Git..."
git config --global http.proxy
git config --system http.proxy
git config --global http.sslVerify false
git config --system http.sslVerify false
git config --global --unset http.sslcainfo
git config --system --unset http.sslcainfo
You can’t perform that action at this time.