Skip to content

Instantly share code, notes, and snippets.

View quicksnap's full-sized avatar
🎮
GitHub has statuses?!

Dan Schuman quicksnap

🎮
GitHub has statuses?!
View GitHub Profile
@OliverJAsh
OliverJAsh / foo.ts
Created November 2, 2018 11:04
React Redux: infer Redux props from mappers
import React, { SFC } from 'react';
import { MapDispatchToPropsParam, MapStateToPropsParam } from 'react-redux';
import { StateRoot } from 'reducers/types';
import { AnyAction, Dispatch } from 'redux';
//
// Helpers
//
const createSubType = <T extends any>() => <SubType extends T>(subType: SubType) => subType;
@hartzis
hartzis / ImageUploadComponent.jsx
Last active April 3, 2023 18:09
React Image Upload with Preview
// https://codepen.io/hartzis/pen/VvNGZP
class ImageUpload extends Component {
constructor(props) {
super(props);
this.state = {
file: '',
imagePreviewUrl: ''
};
this._handleImageChange = this._handleImageChange.bind(this);
this._handleSubmit = this._handleSubmit.bind(this);
@steve-jansen
steve-jansen / README.md
Last active December 13, 2024 23:29
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@staltz
staltz / introrx.md
Last active May 9, 2025 12:50
The introduction to Reactive Programming you've been missing
@owainlewis
owainlewis / ruby.yml
Created October 22, 2013 09:59
Ansible Ruby 2.0 install on Ubuntu Linux
# Install Ruby
## ===============================================
- name: Install dependencies
apt: name=$item state=latest update_cache=yes
with_items:
- bison
- openssl
- libyaml-dev
- autoconf
@quicksnap
quicksnap / post-merge.rb
Created September 1, 2012 22:23 — forked from jmeridth/post-merge.rb
Somewhat hacky post-merge hook for rails bundle/migration updates
#!/usr/bin/env ruby
def is_mac?
RUBY_PLATFORM.downcase.include?("darwin")
end
def getc_input
# http://stackoverflow.com/a/174967/250407
# http://bit.ly/PMZdKv
begin
@paulirish
paulirish / rAF.js
Last active April 17, 2025 15:06
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@BugRoger
BugRoger / ssh-background
Created January 21, 2011 16:02
Changes iTerm2's background color based on host configuration
#!/bin/bash
# Installation:
# 1. Save this script to /some/bin/ssh-background
# 2. chmod 755 /some/bin/ssh-background
# 3. alias ssh=/some/bin/ssh-background
# 4. Configure your host colors below.
set_color() {
local HEX_FG=$1
local HEX_BG=$2