Skip to content

Instantly share code, notes, and snippets.

View raineorshine's full-sized avatar

Raine Revere raineorshine

  • New York, NY
View GitHub Profile
@raineorshine
raineorshine / sublime-cheatsheet.js
Created October 6, 2013 15:46
My Favorite Sublime Text 2 Commands (Mac)
// Files & Commands
cmd + p // quick file switcher
cmd + shift + p // command palette
cmd + r // quick function search
cmd + shift + r // rename file
// Selection
cmd + option + g // select all instances of word under cursor
// Find & Replace
@raineorshine
raineorshine / bash-cheatsheet.sh
Last active April 4, 2018 18:45
Bash Cheat Sheet
type git # get the type of any command. Great for
# seeing if a command exists.
ls -t # sort by time, newest first
ls -tr # sort by time, oldest first
grep -r "test" FILE_OR_DIR # recursive full text search
grep -i "test" FILE # case insensitive
grep -c "pattern" FILE # count
grep -n "pattern" # show line numbers
@raineorshine
raineorshine / python-cheat-sheet.py
Created November 8, 2013 17:05
Python Cheat Sheet
# importing
import sha # import the the sha module
from animal import Animal # import the Animal class from animal.py
# unit testing
# http://docs.python.org/3/library/unittest.html
import unittest
class AnimalTest(unittest.TestCase):
@mauriciopoppe
mauriciopoppe / !README.md
Last active March 18, 2016 16:23
Dark theme for Sublime's Plain Task

Dark theme for Sublime's Plain Task

Installation:

  • Open the "Packages" folder
  • Save the theme under the folder PlainTasks/ with the name "tasks-monokai.hidden-tmTheme"
  • Open the user settings for the package PlainTasks
  • Update the "color-scheme" property (see the file attached below) to match the saved filename
@indexzero
indexzero / ISC.md
Created April 13, 2014 21:00
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@trxcllnt
trxcllnt / curried.sjs
Last active March 18, 2017 13:34
curry and partially apply functions or macros with sweet.js
/*output*//*
var foo = 'd', bar = 'e';
console.log('a', 'b', 'c', foo, bar);
console.log('a', 'b', 'c', foo, 2, 3, 4, 5);
console.log('a', 'c', 'b');
console.log('a', 'd', 'b', 'f', 'e', 'g', foo);
function veryLongFunction() {
console.log.apply(console, arguments);
}
veryLongFunction('a', 'b', 'c', 'd', 'e', 'f');
@danawoodman
danawoodman / 1-react-websockets-reflux.md
Last active September 15, 2021 14:48
Using WebSockets with Reflux and React

WebSockets + Reflux + React

Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.

Overview

This trifect works well if you think of things like so:

  1. Reflux Store: The store fetches, updates and persists data. A store can be a list of items or a single item. Most of the times you reach for this.state in react should instead live within stores. Stores can listen to other stores as well as to events being fired.
  2. Reflux Actions: Actions are triggered by components when the component wants to change the state of the store. A store listens to actions and can listen to more than one set of actions.
@kejace
kejace / ehc-js.md
Last active April 19, 2016 22:43
Ethereum-haskell-client in the browser roadmap

Logging thoughts and approaches on getting (parts of) the Haskell ethereum client running in the browser.

Backends

There are a number of different alternatives. In order of appearance, I estimate the following to languages to need the least amount of porting.

  • GHCJS supports full GHC
  • Haste is full Haskell but with different libraries
  • Fay is a proper subset of Haskell
  • Elm is a Haskell-like language
@Akira-Hayasaka
Akira-Hayasaka / gist:026b7c7ae611bc7485e4
Created April 5, 2015 00:39
osx shutdown, restart, sleep script
Shut down without showing a confirmation dialog:
osascript -e 'tell app "System Events" to shut down'
Shut down after showing a confirmation dialog:
osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
Restart without showing a confirmation dialog:
osascript -e 'tell app "System Events" to restart'
Restart after showing a confirmation dialog:
module TimeApp ( start, Config, App ) where
{-| This module helps you start your application in a typical Elm workflow.
It assumes you are following [the Elm Architecture][arch] and using
[elm-effects][]. From there it will wire everything up for you!
**Be sure to [read the Elm Architecture tutorial][arch] to learn how this all
works!**
[arch]: https://github.com/evancz/elm-architecture-tutorial
[elm-effects]: http://package.elm-lang.org/packages/evancz/elm-effects/latest