Skip to content

Instantly share code, notes, and snippets.

View Gozala's full-sized avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
<script src="ref-send.js"></script>
<script>
(function () {
var delay = function (timeout) {
var deferred = Q.Deferred();
setTimeout(deferred.resolve, timeout);
return deferred.promise;
};

Module Constructor

This is a proposal for the inclusion of an additional primordial variable to all ECMAScript contexts.

  • There MUST be a primordial function Module(text, fileName, lineNo)
    • text MUST be parsed the body of a strict-mode Function
    • Module MAY throw a SyntaxError
    • fileName is an optional name for the text, for debuggers
  • lineNo defaults to 1, is coerced to Number internally, and represents the line
@Gozala
Gozala / expample.js
Created May 29, 2011 11:09
Some stream experiments
/* vim:set ts=2 sw=2 sts=2 expandtab */
/*jshint asi: true undef: true es5: true node: true devel: true
forin: false latedef: false globalstrict: true */
/*global define: true */
"use strict";
var fs = require('fs')
var path = require('path')
@nolanw
nolanw / fscript.rb
Last active September 26, 2015 22:38
Inject F-Script into any app on OS X 10.7 or 10.8. (Yet another F-Script Anywhere replacement.)
#!/usr/bin/env ruby
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
if ARGV.empty?
puts "Usage: #{$0} process_name"
exit
end
GDB = IO.popen("gdb", 'w')
@Gozala
Gozala / index.html
Created November 17, 2011 17:24
GistView: d3.js ~ Streamgraph
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js ~ Streamgraph</title>
<!-- absolute url -->
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.5.1"></script>
<script type='text/javascript' src='http://mbostock.github.com/d3/d3.layout.js?2.5.1'></script>
<!-- relative urls -->
<link href='stream.css' rel='stylesheet' type='text/css'/>
@jrburke
jrburke / amdconfig.md
Created January 18, 2012 00:52
Rough draft of common config understood by loaders

Attempt to list some possible standard AMD loader configuration values.

An AMD loader is not required to implement all of these configuration values, but if it does provide a capability that is satisfied by these configuration values, it should use these configuration values and structures.

baseUrl

String: Indicates the root used for ID-to-path resolutions. Relative paths are relative to the current working directory. In web browsers, the current working directory is the directory containing the web page running the script.

@dherman
dherman / short-functions.js
Created March 10, 2012 16:14
using -> for concise functions and => for TCP functions
// 1. Shorter function syntax.
//
// This version does not respect "Tennent's correspondence principle" -- it's nothing
// more than syntactic sugar for the traditional function syntax. That means when you
// see the normal braced body of a function, whether it's a longhand function or this
// shorthand version, there's no difference: return, this, and arguments are all tied
// to the new function body, and there's no implicit returning of the last expression
// result.
a.some((x) -> {
@swannodette
swannodette / gist:2038633
Created March 14, 2012 18:52
project.clj
(defproject cljs-demo "0.1.0-SNAPSHOT"
:description "ClojureScripting!"
:dev-dependencies [[lein-cljsbuild "0.1.2"]]
:cljsbuild {:builds [{:source-path "src"
:compiler {:optimizations :simple
:pretty-print true}}]})
;; then from project directory
;; ---------------------------
;;
@Calvein
Calvein / Custom.css
Created March 23, 2012 20:24
Solarized Dark Skin for the Chrome DevTools
body#-webkit-web-inspector #main{background-color:#002b36!important}body#-webkit-web-inspector #main .panel.network,body#-webkit-web-inspector #main .panel.timeline,body#-webkit-web-inspector #main .panel.profiles,body#-webkit-web-inspector #main .panel.audits,body#-webkit-web-inspector #main .panel.extension{background-color:#fff!important}body#-webkit-web-inspector #console-messages a:hover,body#-webkit-web-inspector #console-messages .console-formatted-function,body#-webkit-web-inspector #console-messages .console-formatted-object{color:#93a1a1!important}body#-webkit-web-inspector #console-prompt,body#-webkit-web-inspector #console-messages a,body#-webkit-web-inspector #console-messages .console-message,body#-webkit-web-inspector #console-messages .console-group-messages .section .header .title{color:#839496!important}body#-webkit-web-inspector #console-messages .console-formatted-null,body#-webkit-web-inspector #console-messages .console-formatted-undefined{color:#657b83!important}body#-webkit-web-inspect
@Gozala
Gozala / reducers.js
Created May 11, 2012 01:42
Experimenting with clojure reducers
Array.prototype.reduce = this.ArrayReduce || Array.prototype.reduce
var console = window.console
var global = this
function assert(actual, expected) {
if (arguments.length < 2 && actual)
return actual
if (actual === expected)
return actual
if (JSON.stringify(actual) == JSON.stringify(expected))
return JSON.stringify(actual)