This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision highp float; | |
uniform vec3 origResolution; | |
uniform vec3 iResolution; | |
uniform sampler2D iChannel0; | |
uniform bool flip; | |
uniform vec2 direction; | |
vec4 blur9_1_0(sampler2D image, vec2 uv, vec2 resolution, vec2 direction, vec2 a) { | |
vec4 color = vec4(0.0); | |
vec2 off1 = (vec2(1.3846153846) * direction) / resolution; | |
vec2 off2 = (vec2(3.2307692308) * direction) / resolution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
delegate T Out<T>(T x); | |
delegate Out<T> RecOut<T>(RecOut<T> x); | |
class YClass<T> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ElementContext = React.createContext(null); | |
class ElementContextComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.elementRef = React.createRef(); | |
} | |
render() { | |
return ( | |
<ElementContext.Provider value={{elRef: this.elementRef, styles: {}, timeout: null}}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function treeGraph(t){ | |
var resultPoints=[],resultLines=[]; | |
resultPoints.push({name:t.name}); | |
if(t.children){ | |
t.children.forEach(function(ct){ | |
var childResult=treeGraph(ct); | |
resultLines.push({ | |
source: t.name, | |
target: ct.name | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SomeReactComponent = class extends React.Component { | |
render() { | |
return this.props.render(); | |
} | |
}; | |
export default { | |
props: { | |
reactComponent: Function, | |
reactComponentProps: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EventOptions } from "hyperapp-event-options"; // assuming there existed something like that | |
export function Component(props) { | |
return (<button on={{ | |
click: [ | |
props.doSomething, | |
EventOptions.preventDefault | EventOptions.stopPropagation | EventOptions.hookDocument | EventOptions.capture | |
] | |
}}>Button content</button>); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var some = function (x) { | |
if (Array.isArray(x)) { | |
return [].concat.apply([], x.map(some)); | |
} | |
if (typeof x === "function") { | |
return some(x()); | |
} | |
return x; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Some<T> = (x: T) => T; | |
var add = function <T>(m: Some<Some<T>>, n: Some<Some<T>>) { | |
return function (f: Some<T>) { | |
return function (x: T) { | |
return m(f)(n(f)(x)); | |
}; | |
}; | |
}, mul = function <T>(m: Some<Some<T>>, n: Some<Some<T>>) { | |
return function (f: Some<T>) { | |
return m(n(f)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...crypto.getRandomValues(new Uint8Array(8))].map(function (x) { | |
var t = x.toString(16); | |
return t.length === 2 ? t : "0" + t; | |
}).join(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.handler = function(event, context, callback) { | |
require("dns").lookup("gist.github.com",function(...x){ | |
callback(...x); | |
}); | |
}; |