Skip to content

Instantly share code, notes, and snippets.

View raineorshine's full-sized avatar

Raine Revere raineorshine

  • New York, NY
View GitHub Profile
@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
@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.
@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');
@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

@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
@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):
@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 / 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
@shawnbot
shawnbot / index.md
Last active August 23, 2023 10:18
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

@raineorshine
raineorshine / responsive.css
Last active November 19, 2022 06:08
Cheat Sheet: Responsive Design
@media all and (max-width: 1024px) {...}
@media all and (min-width: 800px) and (max-width: 1024px) {...}
@media not screen and (color) {...}
@media only screen and (orientation: portrait) {...}
@media all and (max-width: 420px) {
section, aside {
float: none;
width: auto;
}