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 / _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 /
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.

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 / 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 / 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;
View insertAfterEveryFromRight.js
var insertAfterEveryFromRight = function _insertAfterEveryFromRight(str, insert, every) {
var result = '';
str.split('').reverse().forEach(function(s, idx) {
if (idx !== 0 && idx % every === 0) {
result += insert;
result += s;
View wiki-travel-voyage-redirect.user.js
// @name Redirect from WikiTravel to WikiVoyage
// @description Automatically switch from a article to the same article on
// @namespace
// @include*
// @version v20130218.1
// ==/UserScript==
(function _wikivoyage_redir (win) {
// Example
// Before:
patik / adn-auth.php
Created Oct 11, 2012
ADN auth issue
View adn-auth.php
require_once('keys.php'); // Where my constants are defined
$clientId = ADN_CLIENT_ID;
$clientSecret = ADN_CLIENT_SECRET;
$redirectUri = ADN_REDIRECT_URI;
# User has authorized:
if (isset($_GET['code']) && !empty($_GET['code'])) {
patik / wysihtml5.multi.example.html
Created Sep 3, 2012
wysihtml5 mulitiple editors issue
View wysihtml5.multi.example.html
<div id="alpha-toolbar"><!-- Toolbar commands here --></div>
<textarea id="alpha"></textarea>
<div id="bravo-toolbar"><!-- Toolbar commands here --></div>
<textarea id="bravo"></textarea>
<div id="charlie-toolbar"><!-- Toolbar commands here --></div>
<textarea id="charlie"></textarea>
View alpha-app-net-enhanced.user.js
// @name Enhanced Alpha.App.Net
// @description Image previews, Repost links, and Twitter character count on Alpha.App.Net
// @namespace
// @include*
// @version v20120903.1
// ==/UserScript==
(function _adnenhance_init(win) {
var adnenh = {};
You can’t perform that action at this time.