Skip to content

Instantly share code, notes, and snippets.

@ironfroggy
ironfroggy / gist:6794356
Created October 2, 2013 14:07
Ideas I'm playing with on using Web Components to declaratively define custom elements and behavior entirely in mark-up On its own, neat and not that original. But i think Web Components make this idea particularly powerful and accessible. More so, I'm interested in combining this with a web component authoring tool, which might allow component-…
<todo-item id=todo-939528>
<input type=checkbox on-click=toggle>
<span class=todo-label>
<do-bind target=.todo-edit></do-bind>
</span>
<input class=hidden class=todo-edit value="Show how a declarative style might work" />
<do-action name=toggle>
<do-set-attribute target="[type=checkbox]" attribute=checked>checked</do-set-attribute>
</do-action>
@-webkit-keyframes sway
{
from {-webkit-transform: rotate(-10deg);}
to {-webkit-transform: rotate(10deg);}
}
@-moz-keyframes sway
{
from {-moz-transform: rotate(-10deg);}
to {-moz-transform: rotate(10deg);}
}
@ironfroggy
ironfroggy / gist:9785859
Created March 26, 2014 15:21
Pull Request command
function pr() {
BRANCH=$(git branch | grep "*" | sed -r 's/^.{2}//')
git push origin $BRANCH
if [[ $1 = "" ]]
then
ISSUE=$(echo $BRANCH | cut -d- -f1)
else
ISSUE=$1
fi
GHACCT=$(git config --get remote.origin.url | cut -d: -f2 | cut -d/ -f1)
### Keybase proof
I hereby claim:
* I am ironfroggy on github.
* I am ironfroggy (https://keybase.io/ironfroggy) on keybase.
* I have a public key whose fingerprint is AB26 8CFC FB81 86B0 452D 48E5 EE3F E243 105E 3FD2
To claim this, I am signing this object:
@ironfroggy
ironfroggy / id_rsa.pub
Created October 15, 2014 15:05
Public RSA Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCTO6iLB0li7u3hMyayMKw67YYpwgKtTyBK8d3BX1pTz7eboKiED1h9x41+7CaI49GllD8taN+5jnfh3VUNgiRfgQQq6Q2Neh1+LluKVGOtx4nnTl9N9n99z2LOrXloreTxVOjThH64wW+AX65Yp6ZSqnfwd1LsHoWQBfhfoEr34Mr1ZZvdLQvDyXDBd+DKegy8Ds5Yx2lgFYVddquUAbQF4wBgV2Z1nMgeSuujtLI8BPZOr3qwzS4pYEdqDTtJASFrsbEN/eq45xc1vlqg+P1oCF/aZGD+0i5irbL4zz06g1y+MzkRDRalOdqiP9egSvubZ3T+IV0gmVDMCA5OBB3F calvin@caktus001
fetch('/users.json')
.then(function(response) {
return response.json()
}).then(function(json) {
console.log('parsed json', json)
}).catch(function(ex) {
console.log('parsing failed', ex)
})
name: math
is a: service
operations:
pathagorean: a, b
a squared: a ** 2
b squared: b ** 2
c squared: a squared + b squared
result: square root: c squared
public class InputManager : StateMachineBehavior<InputManager.InputState> {
public class InputState : State {
public virtual void OnHits(RaycastHit[] hits) {
}
}
public class StateIdle : InputState {
public override void OnHits(RaycastHit[] hits) {
if (hits.Length > 0) {
class AutoComponent extends React.Component {
constructor() {
super()
var cls = this.constructor
var methods, methodName
while (cls !== AutoComponent) {
methods = Object.getOwnPropertyNames(cls.prototype)
for (var i in methods) {
methodName = methods[i]
if (methodName.match(/^on[A-Z]/) !== null) {