create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
<? | |
/** | |
* SSL Redirect Custom Controller Plugin | |
* | |
* This plugin will allow you to redirect your users between https:// and | |
* http:// and vice versa. All you have to do is add the plugin to your | |
* stack and add what modules, controllers, and actions you want to have | |
* SSL and thats it. | |
* | |
* |
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
<html> | |
<body> | |
<?php | |
ini_set('display_errors', 1); | |
//memcache | |
echo "memcache " . extension_loaded("memcache") . "<br/>"; | |
$memcache = new Memcache; | |
$memcache->connect('localhost', 11211) or die ("Could not connect"); | |
$key = md5('test-memcache'); //something unique |
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
#!/bin/bash -eu | |
# | |
# Color log4j-style logs for easier visual parsing. | |
# | |
# Usage: | |
# tail foo.log | log-color | |
# run-service | log-color | |
black="` tput setaf 0; tput bold`" | |
red="` tput setaf 1; tput bold`" |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
<?php | |
/** | |
* Getting nested set model into a <ul> but hiding “closed” subtrees | |
* | |
* @link http://stackoverflow.com/a/7786733/367456 | |
*/ | |
// $categories = get_categories(); | |
$categories = get_categories_large(); | |
$current = array('lft' => '14', 'rgt' => '13'); |
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.