most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
// | |
// _oo8oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/'==='\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||_ \ |
/** | |
* ArcUtils.java | |
* | |
* Copyright (c) 2014 BioWink GmbH. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
My list of commonly used sites for web development
Tool | Address |
---|---|
Create Data URLs | http://dataurl.net/#about |
Desktop Browser Compatibility Tables For DOM Events | http://www.webbrowsercompatibility.com |
Can I Use | http://caniuse.com/ |
PHP Composer repository | https://packagist.org |
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' |
function removeEmoji($text) | |
{ | |
$cleanText = ""; | |
// Match Emoticons | |
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; | |
$cleanText = preg_replace($regexEmoticons, '', $text); | |
// Match Miscellaneous Symbols and Pictographs | |
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u'; |
We want to upload file to a server with POST HTTP request. We will use curl functions.
// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");
// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");;
<?php | |
/** | |
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you | |
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile | |
* type). You can use php://temp to get around this for one file, but if you want to upload | |
* multiple files then you've got a bit more work. | |
* | |
* This function manually constructs the multipart request body from strings and injects it | |
* into the supplied curl handle, with no need to touch the file system. |
#!/usr/bin/env bash | |
# This script prints out all of your Redis keys and their size in a human readable format | |
# Copyright 2013 Brent O'Connor | |
# License: http://www.apache.org/licenses/LICENSE-2.0 | |
human_size() { | |
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
} |