As configured in my dotfiles.
start new:
tmux
start new with session name:
<?php | |
function longest_common_substring($words) | |
{ | |
$words = array_map('strtolower', array_map('trim', $words)); | |
$sort_by_strlen = create_function('$a, $b', 'if (strlen($a) == strlen($b)) { return strcmp($a, $b); } return (strlen($a) < strlen($b)) ? -1 : 1;'); | |
usort($words, $sort_by_strlen); | |
// We have to assume that each string has something in common with the first | |
// string (post sort), we just need to figure out what the longest common | |
// string is. If any string DOES NOT have something in common with the first | |
// string, return false. |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
img.centered { | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
} |
# JS snippet for email notification settings, e. g. Twitter | |
cb=document.querySelectorAll('input[type="checkbox"]');for(i in cb){cb[i].checked=false} | |
# for Drupal 4.x comment approval form | |
cbx=document.getElementsByClassName('form-checkbox');for(i in cbx){cbx[i].checked=true} |
/*jslint browser: true, indent: 2 */ | |
var Delayed = (function (delay) { | |
/*! Andrea Giammarchi - Mit Style License */ | |
// https://gist.github.com/WebReflection/7286687 | |
'use strict'; | |
// method shared across all delayed wrappers | |
function clear() { |
#!/bin/bash | |
# Hacked together by JeroenJanssens.com on 2013-12-10 | |
# Requires: https://github.com/joewalnes/websocketd | |
# Run: websocketd --devconsole --port 8080 ./chat.sh | |
echo "Please enter your name:"; read USER | |
echo "[$(date)] ${USER} joined the chat" >> chat.log | |
echo "[$(date)] Welcome to the chat ${USER}!" | |
tail -n 0 -f chat.log --pid=$$ | grep --line-buffered -v "] ${USER}>" & | |
while read MSG; do echo "[$(date)] ${USER}> ${MSG}" >> chat.log; done |
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |