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
function sharpen(ctx, w, h, mix) { | |
var x, sx, sy, r, g, b, a, dstOff, srcOff, wt, cx, cy, scy, scx, | |
weights = [0, -1, 0, -1, 5, -1, 0, -1, 0], | |
katet = Math.round(Math.sqrt(weights.length)), | |
half = (katet * 0.5) | 0, | |
dstData = ctx.createImageData(w, h), | |
dstBuff = dstData.data, | |
srcBuff = ctx.getImageData(0, 0, w, h).data, | |
y = h; |
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
const boundary = '----' + Math.random(); | |
const data = [ | |
'--' + boundary, | |
'Content-Disposition: form-data; name="operations"', | |
'\r\n', | |
'{"query":"mutation($file: Upload!){uploadImage(file:$file){id,uuid}}"}', | |
'--' + boundary, | |
'Content-Disposition: form-data; name="map"', | |
'\r\n', | |
'{"0":["variables.file"]}', |
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
const fs = require('fs'); | |
const glob = require('glob'); | |
const sharp = require('sharp'); | |
const Promise = require('bluebird'); | |
const successList = []; | |
const errorList = {}; | |
glob("wp-content/uploads/**/*.+(jpeg|jpg)", function (er, files) { | |
Promise.resolve(files) |
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 | |
# This script zeroes out any space not needed for packaging a new Ubuntu Vagrant base box. | |
# Run the following command in a root shell: | |
# | |
# bash <(curl -s https://gist.github.com/justindowning/5670884/raw/vagrant-clean.sh) | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} |
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
server { | |
listen 80; | |
server_name *.dev; | |
location / { | |
proxy_pass http://localhost:8080; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_connect_timeout 150; |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/->(\1)/' | |
} | |
check_node() { | |
diff <(node -v 2> /dev/null) <(cat .nvmrc 2> /dev/null) | sed -e "/^[^>*]/d" -e 's/>.* \(.*\)/>\1</' | |
} | |
current_node() { | |
node -v 2> /dev/null | sed 's/\(.*\)/->(\1)/' | |
} | |
export PS1="[\[\e[31;1m\]\u\[\e[0m\]\[\e[35m\]@\[\e[0m\]\[\e[33m\]\h\[\e[0m\]:\[\e[36;1m\]\w\[\e[0m\]]\[\e[1;31m\]\$(check_node)\[\e[0m\]\[\e[1;34m\]\$(current_node)\[\e[0m\]\[\e[32m\]\$(parse_git_branch)\[\e[0m\]\n\[\e[1;32m\]\\$\[\e[0m\] " |
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 Person = function(location) { | |
this.location = location; | |
}; | |
Person.prototype.goto = function() { | |
console.log('goto: ', this.location); | |
}; | |
prodebug(Person); |
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
<?php | |
namespace Application; | |
use Locale; | |
use Zend\EventManager\Event; | |
use Zend\ModuleManager\Feature; | |
class Module implements | |
Feature\BootstrapListenerInterface | |
{ |
NewerOlder