Skip to content

Instantly share code, notes, and snippets.

View iamdustan's full-sized avatar

Dustan Kasten iamdustan

View GitHub Profile
@kennyp
kennyp / watch-the-ding
Created February 21, 2013 20:48
Replace `_` with `/` for paths. .irssi files live on the server `watch-the-ding' is local.
#!/usr/bin/bash
ssh new.jroes.net 'cat /dev/null > ~/.the-ding && tail -f ~/.the-ding' | while read hit
do
mplayer -really-quiet -noar /usr/share/sounds/gnome/default/alerts/glass.* &> /dev/null
done
@lakenen
lakenen / jquery.xdr.js
Created March 27, 2013 06:08
jQuery XDR for IE
(function ($) {
"use strict";
if (window.XDomainRequest) {
$.ajaxTransport(function(s) {
if (s.crossDomain && s.async) {
if (s.timeout) {
s.xdrTimeout = s.timeout;
delete s.timeout;
}
var xdr;
@blainekasten
blainekasten / jquery.weekcalendar.css
Created March 28, 2013 15:55
Backbone Calendar Structure
<head>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<link rel='stylesheet' type='text/css' href='js/libs/css/smoothness/jquery-ui-1.8.11.custom.css' />
</head>
<body>
<script type="text/html" id="CalendarTemplate">
<div id="calendar" style="border:2px solid black;">
<div class="ui-widget wc-container">
<div class="ui-widget-header wc-toolbar">
<div class="wc-display ui-buttonset">

I would like to propose a lightning talk for the Reactive Conference demonstrating how you can interact with Arduino and/or Raspberry Pi GPIO's using React Native.

Here's is an example video where fellow speaker Brent Vatne controls my arduino device remotely using a sample react native app that can be found here

Thank you, @christopherdro

Parser

  • /src/parser/spider_monkey_ast.ml: The type definitions for the AST. Tries to stay very close to ESTree
  • /src/parser/lexer_flow.mll: The ocamllex lexer logic
  • /src/parser/parser_flow.ml: The recursive descent JS parser

Inference

  • /src/typing/type_inference_js.ml: Contains the "entry point" for inference (Function called infer_ast).
  • /src/typing/statement.ml: Most of the inference logic (runs through the AST and generates the initial constraints)
@joshduck
joshduck / gist:0c35f70cdd3abf88770c
Created February 24, 2016 21:58
ReactPerf to Web Tracing Framework
const ReactPerf = require('ReactPerf');
const TRACE_DOM = false;
function reactPerfTrace(objName: string, fnName: string, func: any): any {
return function(component) {
let label;
if (objName === 'ReactCompositeComponent') {
var instName = this.getName() || 'Unknown';
label = fnName === 'mountComponent' || fnName === 'updateComponent' ? instName : `${instName}.${fnName}`;
@gaearon
gaearon / reducers.js
Last active December 11, 2020 14:56
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@bhauman
bhauman / core.cljs
Last active August 16, 2022 12:08
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#