Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

RomyRomy syntacticsugar

🎯
Focusing
View GitHub Profile
View gist:2011138b1b2a8411d8911853603f8d52
// © 2011 Artem Sapegin http://sapegin.ru
// Simple CSS3 properties with vendor prefixes
box-sizing()
-moz-box-sizing arguments
box-sizing arguments
box-shadow()
-webkit-box-shadow arguments
@syntacticsugar
syntacticsugar / MultiSelect.jsx
Created Mar 1, 2017 — forked from kkoch986/MultiSelect.jsx
A MultiSelect prototype for Material UI (v.0.14.4)
View MultiSelect.jsx
/**
* Material UI multi select
*
* Use with:
* <MultiSelect fullWidth={true} value={this.state.values} onChange={(e,v) => this.setState({values: v})}>
* <ListItem primaryText={"Option 1"} value={1} />
* <ListItem primaryText={"Option 2"} value={2} />
* <ListItem primaryText={"Option 3"} value={3} />
* <ListItem primaryText={"Option 4"} value={4} />
* </MultiSelect>
View bootstrap_form_override.css
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
View README.md

How to Use

Open up Terminal.app in your /Applications/Utilities directory, then type in these commands, one after each other:

  1. Create a temporary directory for cycript:

    mkdir cycript && cd cycript
    
  2. Pull the latest cycript from cycript.org:

View rubymas.rb
class Fixnum
def ordinal
%w[first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth][self - 1]
end
# Use #to_word rather than #to_s, so it doesn't break any other printing of numbers.
def to_word
%w[one two three four five six seven eight nine ten eleven twelve][self - 1]
end
end
View mk-notes.scm
(define menu
(lambda (x y)
(conde
[(== x 'tea) (== y 'biscuit)]
[(== x 'coffee) (== y 'cookie)])))
(define conso
(lambda (x y o)
(== `(,x . ,y) o)))
View hs_js_clj.core.clj
(ns hs-js-clj.core)
(def foo {:bar 1})
(defn fooify [n] (str "foo" n))
(defn commaify [[x y]]
(str x ", " y))
View hs.js
console.log("hello");
function LazySeq(head, tail) {
this.head = head; // value
this.tail = tail; // thunk || null
}
function ints(n) {
return new LazySeq(n, function() { return ints(n+1); });
}
View mousetracks.html
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="encoding" content="utf-8">
</head>
<canvas id="canvas" width="1490" height="512" style="border:1px dashed">
CA canvas
</canvas>
<script type="text/javascript">
var canvas = document.getElementById("canvas");
View commaifier.rb
def modulo_3?(number)
# (number % 3).zero?
number.modulo(3).zero? # i guess this is more idiomatic Ruby, though I like the previous better
end
def commify(number)
reversed = number.to_s.reverse
number_size = number.to_s.size
result = ""