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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
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 quicksort(arr, comp0) { | |
if (arr.length <= 1) { | |
return arr; | |
} | |
const comp = comp0 ? comp0 : (a, b) => parseInt(a) - parseInt(b); | |
const pivot = arr[0]; | |
const higher = []; | |
const lower = []; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="https://unpkg.com/vue"></script> | |
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.0/vue.min.js"></script> --> | |
<!-- <script src="https://cdn.jsdelivr.net/vue.resource/1.2.1/vue-resource.min.js"></script> --> |
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
(defmacro compact [& args] | |
(assert (and (every? symbol? args) | |
(every? (comp var? resolve) args)) | |
"Each of the arguments must be a defined symbol") | |
(zipmap (map keyword args) args)) |
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
<?php | |
namespace App; | |
use Illuminate\Contracts\Support\Responsable; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
trait ResponsableQuery | |
{ |
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
// https://vuejs.org/v2/guide/components.html#DOM-Template-Parsing-Caveats | |
const originalRender = ReactDOM.render | |
const components = { } | |
function renderElement (e, i) { | |
return e.tagName | |
? React.createElement( | |
components[e.localName] || e.localName, | |
Array.from(e.attributes).reduce((r, n) => { r[n.localName] = eval(n.nodeValue); return r; }, { key: i }), |
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
lumo -c src:~/.m2/repository/org/clojure/tools.analyzer.jvm/0.7.0/tools.analyzer.jvm-0.7.0.jar:~/.m2/repository/com/cognitect/transit-cljs/0.8.239/transit-cljs-0.8.239.jar:~/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar:~/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:~/.m2/repository/org/clojure/clojurescript/1.9.89/clojurescript-1.9.89.jar:~/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20150505-021ed5b3/google-closure-library-third-party-0.0-20150505-021ed5b3.jar:~/.m2/repository/com/google/javascript/closure-compiler/v20160315/closure-compiler-v20160315.jar:~/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:~/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20151016-61277aea/google-closure-library-third-party-0.0-20151016-61277aea.jar:~/.m2/repository/com/google/javascript/closure-compiler-externs/v20150505/closure-compiler-externs-v20150505.jar:~/.m2/repository/com/google/guava/guava/17. |
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
'use strict'; | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); | |
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); | |
const eslintFormatter = require('react-dev-utils/eslintFormatter'); | |
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); |
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
// https://gist.github.com/fernandezpablo85/d020ea0efada7f5d4ab746f803ce723c | |
class deferred { | |
thens = [] | |
then (fn) { | |
this.thens.push(fn) | |
return this | |
} |