This file contains hidden or 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 { IBasicObject } from './objects'; | |
| export interface IValidator<T> { | |
| run: IValidatorRun<T>; | |
| concat: (other: IValidator<T>) => IValidator<T>; | |
| } | |
| export type ValidatorTypes = [] | undefined | string; | |
| export type IValidatorRun<T> = (key: string, x: T, rec: IBasicObject) => IValidator<T>; |
This file contains hidden or 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
| (() => { | |
| let getMeta = (itemProp) => { | |
| let metas = document.getElementsByTagName('meta'); | |
| for (let i = 0; i < metas.length; i++) { | |
| if (metas[i].getAttribute('itemprop') === itemProp) { | |
| return metas[i].getAttribute('content'); | |
| } | |
| } |
This file contains hidden or 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
| {Task, fn -> ping_nodes() end} | |
| defp ping_nodes() do | |
| Process.sleep(1_000) | |
| Node.list() | |
| |> Enum.each(fn node -> | |
| IO.puts("[#{inspect(Node.self())} -> #{inspect(node)}] #{inspect(Node.ping(node))}") | |
| end) | |
| ping_nodes() | |
| end |
This file contains hidden or 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
| #!/bin/sh | |
| # script for optimizing images in a directory (recursive) | |
| # pngcrush & jpegtran settings from: | |
| # http://developer.yahoo.com/performance/rules.html#opt_images | |
| # pngcrush | |
| for png in `find $1 -iname "*.png"`; do | |
| echo "crushing $png ..." | |
| pngcrush -rem alla -reduce -brute "$png" temp.png |
This file contains hidden or 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
| #!/bin/bash | |
| function codemods() { | |
| echo "-----" | |
| echo "Running $1 from https://github.com/JamieMason/codemods.git" | |
| jscodeshift -t "${TMPDIR}codemods/transforms/$1.js" "$2" | |
| } | |
| function js_codemod() { | |
| echo "-----" |
This file contains hidden or 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
| #/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # git hook to run a command after `git pull` if a specified file was changed | |
| # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep --quiet "$1" && eval "$2" |
This file contains hidden or 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
| filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS); |
This file contains hidden or 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 loadCSS = function (href) { | |
| var cssLink = $("<link rel='stylesheet' type='text/css' href='" + href + "'>"); | |
| $("head").append(cssLink); | |
| }; | |
| // Could load the JS at the end of the body, depends on the case | |
| var loadJS = function (src) { | |
| var jsLink = $("<script type='text/javascript' src='" + src + "'>"); | |
| $("head").append(jsLink); | |
| }; |
This file contains hidden or 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
| @-moz-document url-prefix() { | |
| // Rules | |
| } |
This file contains hidden or 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
| # | |
| # Varnish VCL file for Ghost blogging platform. | |
| # http://ghost.org/ | |
| # | |
| # Written for Ghost v0.3.0. | |
| # | |
| # This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2 | |
| # minutes, and everything below /ghost/ is pass()-ed so the user sessions | |
| # work. | |
| # |