Skip to content

Instantly share code, notes, and snippets.

View aronwoost's full-sized avatar

Aron Woost aronwoost

View GitHub Profile
@kolodny
kolodny / actions.js
Last active May 17, 2018 18:42
testing redux thunk middleware
export const doTheThing = () => (dispatch, getState) => {
const users = getState();
dispatch({
type: 'THE_THING',
users,
});
};
@codler
codler / flex.less
Last active October 7, 2023 07:01
Prefix flex for IE10 and Safari / iOS in LESS
/*! Prefix flex for IE10 and Safari / iOS in LESS
* https://gist.github.com/codler/2148ba4ff096a19f08ea
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
.display(@value) when (@value = flex) {
display: -ms-flexbox; // IE10
display: -webkit-flex; // Safari / iOS
}
.display(@value) when (@value = inline-flex) {
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@caseyohara
caseyohara / reserved_usernames.rb
Created December 9, 2011 22:58
A list of reserved usernames to avoid vanity URL collision with resource paths
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here:
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active February 20, 2024 11:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version