Skip to content

Instantly share code, notes, and snippets.

View brandondurham's full-sized avatar

Brandon Durham brandondurham

View GitHub Profile
javascript:
__cnt__=0;
__buttons__=jQuery(".content-main .user-actions-follow-button");
__length__=__buttons__.length;
__interval__=setInterval(function () {
el=jQuery(__buttons__[__cnt__]);
if (__cnt__ === __length__) {
alert("All done!");
clearInterval(__interval__);
}
[
{
"popularity":3,
"translated":true,
"adult":false,
"language":"en",
"original_name":"Annie Hall",
"name":"Annie Hall",
"alternative_name":"Io e Annie",
"movie_type":"movie",
@brandondurham
brandondurham / font-stack mixin
Last active December 31, 2015 01:19
SASS Mixin for use with the Cloud.typography service.
@mixin font-stack($family, $weight, $size: inherit, $line-height: inherit, $style: normal, $stack: '"Lucida Grande", "Lucida Sans", Verdana, Helvetica, Arial, sans-serif') {
@if $weight >= 6 { -webkit-font-smoothing: antialiased; } // Sharpen up the bold text
font: {
@if $style == normal {
family: "#{$family} #{$weight}r", "#{$family} A", "#{$family} B", unquote($stack);
}
@else if $style == italic {
family: "#{$family} #{$weight}i", "#{$family} A", "#{$family} B", unquote($stack);
}
size: $size;
import React, {Component, PropTypes} from 'react';
import Hammer from 'react-hammerjs';
import classNames from 'classnames';
export default class ScrollPanel extends Component {
static propTypes = {
items: PropTypes.array,
menuStyle: PropTypes.string,
selectedItem: PropTypes.number,
javascript:
__cnt__=0;
__sep__="";
__username__=jQuery('.content-main .account-group');
__length__=__username__.length;
__usernames__='';
__interval__=setInterval(function () {
el=jQuery(__username__[__cnt__]);
if (__cnt__ === __length__) {
div = $('<div></div>');
@brandondurham
brandondurham / swipeFunc.js
Last active June 20, 2016 20:21 — forked from localpcguy/swipeFunc.js
Updated swipe script for React
import React, { Component } from 'react';
import update from 'react-addons-update';
export default class App extends Component {
state = {
touches: {
touchstart: {
x: -1,
y: -1
@brandondurham
brandondurham / 0_reuse_code.js
Created March 8, 2017 16:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@brandondurham
brandondurham / Blog_decorator.js
Last active May 28, 2017 21:04
Higher-order component to ensure all static, same-domain links loaded from external sources use the router method
// To use with your component as a decorator:
import React from 'react';
import styles from './styles.css';
import Internalize from 'components/InternalLinks';
@Internalize
export default class BlogContent extends React.Component {
static propTypes = {
content: PropTypes.static.isRequired
@brandondurham
brandondurham / gist:5e127344f3fea6be5f78442966837879
Created July 30, 2018 02:57
CSS: List using a counter that starts with “0” and uses “decimal-leading-zero”
/* CSS */
.Chapters {
column-count: 2;
counter-reset: toc -1;
}
.Chapter {
counter-increment: toc;
list-style-type: none;
@brandondurham
brandondurham / convert_spaces_to_tabs.sublime-macro
Last active March 17, 2020 02:33
Convert indentation from 2 spaces to tabs in Sublime Text
// Convert 2 spaces to tabs in Sublime Text
// To add a key binding, go to "Sublime Text » Preferences » Key Bindings - User" and add the following line:
// { "keys": ["super+;"], "command": "run_macro_file", "args": {"file": "Packages/User/convert_spaces_to_tabs.sublime-macro"} }
// Change the `super+;` shortcut accordingly.
[
{
"args": {
"setting": "tab_size",
"value": 2