Skip to content

Instantly share code, notes, and snippets.

seabaylea /
Created Jun 11, 2016
How to build a Swift toolchain on Linux with full Dispatch and NSURLSession support

Follow the instructions to checkout a full Swift build for Linux:

git clone
cd swift
./utils/update-checkout --clone

Update the libdispatch component to use the 'experimental/foundation' branch:

cd swift-corelibs-libdispatch
beaucharman / debounce.js
Last active Feb 25, 2022
An ES6 implementation of the debounce function. "Debouncing enforces that a function not be called again until a certain amount of time has passed without it being called. As in 'execute this function only if 100 milliseconds have passed without it being called.'" - CSS-Tricks (…
View debounce.js
function debounce(callback, wait, immediate = false) {
let timeout = null
return function() {
const callNow = immediate && !timeout
const next = () => callback.apply(this, arguments)
timeout = setTimeout(next, wait)
lukewhitehouse /
Last active Sep 10, 2015
Check for if an element is in view

Check for if an element is in view

This script allows you to tell when an element becomes visible in the browser window. You can use this to apply styling/animations to elements.


Add this to your javascript. Make sure jQuery is called before this script.


  • jQuery
stuartjmoore / WPTextAttachment.h
Last active Oct 21, 2016
Creates an NSTextAttachment the takes up the entire width of the line fragment (while maintaining its aspect ratio). Instead of a simple image, any UIView (that has a (CGFloat)heightThatFits method) will work.
View WPTextAttachment.h
// WPTextAttachment.h
// ReadArticle
// Created by Moore, Stuart on 12/27/13.
// Copyright (c) 2013 The Washington Post. All rights reserved.
#import <UIKit/UIKit.h>
eytanschulman / gist:8521776
Created Jan 20, 2014
How to make UIActivityViewController not lag
View gist:8521776
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self presentViewController:activityVC animated:YES completion:^{
shobotch /
Last active Nov 22, 2022
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

coenjacobs / wc-attribute-links.php
Created May 4, 2012
Display WooCommerce product attribute archive links on product page, right below the add to cart button.
View wc-attribute-links.php
dhm116 / ie.shims.js
Created Feb 10, 2012
IE7/8 Javascript method shims
View ie.shims.js
'use strict';
// Add ECMA262-5 method binding if not supported natively
if (!('bind' in Function.prototype)) {
Function.prototype.bind= function(owner) {
var that= this;
if (arguments.length<=1) {
return function() {
return that.apply(owner, arguments);