module Group where
import List.Extra exposing (span)
countingGroupBy : (a -> b) -> List a -> List (b, Int)
countingGroupBy key xs' =
let
eq a b = key a == key b
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
uploadMethod: 'PUT', | |
uploadAdded: function(file, item) { | |
//Recieve the signed PUT request here | |
//I can create another GIST if anyone would like the code for signing the requests | |
mydropzone.options.url = url; | |
}, | |
uploadSending: function(file, formData, xhr) { | |
xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream'); |
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
{ | |
"title": "TouchCursor Mode", | |
"rules": [ | |
{ | |
"description": "TouchCursor Mode [Space as Trigger Key]", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "spacebar", |
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'; | |
/** | |
* Adds the posibility to configure AWS_IAM for your API Gateway endpoints | |
* and "Invoke with caller credentials" | |
* | |
* Usage: | |
* | |
* myFuncGetItem: |
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
/** | |
* Knockout.js extension that gives both new and old value to | |
* subscription functions. | |
* | |
* Credit: http://stackoverflow.com/a/18184016/204610 | |
* | |
* Changed JBeagle's code to return a disposable subscription | |
* object so it conforms to subscribe() | |
*/ | |
ko.subscribable.fn.subscribeChanged = function (callback) { |
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 * just (...values) { | |
yield * values; | |
}; | |
function first (iterable) { | |
const iterator = iterable[Symbol.iterator](); | |
const { done, value } = iterator.next(); | |
if (!done) return value; | |
}; |
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
/* | |
+ assuming you're using cookie-session or similar session | |
usage: | |
import authenticated from "./middleware/authenticated.js" | |
server.use(authenticated) | |
*/ |
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
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; |
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
" netrw | |
let g:netrw_banner = 0 " hide banner | |
let g:netrw_altv=1 " open splits to the right | |
let g:netrw_liststyle=3 " tree view | |
let g:netrw_list_hide=netrw_gitignore#Hide() | |
function! s:open_netrw() | |
" Grab the current file name | |
let file_name = expand("%:t") | |
" Open a 20-column left-side netrw explorer in the directory for the current |
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 worker() { | |
setInterval(function() { | |
postMessage({foo: "bar"}); | |
}, 1000); | |
} | |
var code = worker.toString(); | |
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}")); | |
var blob = new Blob([code], {type: "application/javascript"}); |
OlderNewer