As configured in my dotfiles.
start new:
tmux
start new with session name:
# | |
# mkcd command | |
# This is an improvised version of the mkcd command at http://superuser.com/questions/152794/is-there-a-shortcut-to-mkdir-foo-and-immediately-cd-into-it | |
# This function has to be added to the ~/.bashrc file | |
# After that you can run command like: mkdir abc, mkdir -p one/two/three | |
# | |
function mkcd { | |
last=$(eval "echo \$$#") | |
if [ ! -n "$last" ]; then | |
echo "Enter a directory name" |
Date.prototype.toLocalISOString = function(){ | |
// ISO 8601 | |
var d = this | |
, pad = function (n){return n<10 ? '0'+n : n} | |
, tz = d.getTimezoneOffset() //mins | |
, tzs = (tz>0?"-":"+") + pad(parseInt(tz/60)) | |
if (tz%60 != 0) | |
tzs += pad(tz%60) | |
(function($){ | |
ListFilterCollapsePrototype = { | |
bindToggle: function(){ | |
var that = this; | |
this.$filterTitle.click(function(){ | |
that.$filterContent.slideToggle(); | |
that.$list.toggleClass('filtered'); | |
}); | |
}, | |
init: function(filterEl) { |
As configured in my dotfiles.
start new:
tmux
start new with session name:
worker_processes 1; | |
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
[skin] | |
description=Ajnasz Blue Theme. Midnight Commander skin from Ajnasz. | |
[Lines] | |
horiz=─ | |
vert=│ | |
lefttop=┌ | |
righttop=┐ | |
leftbottom=└ | |
rightbottom=┘ |
<?php | |
function slugify($string, $replace = array(), $delimiter = '-') { | |
// https://github.com/phalcon/incubator/blob/master/Library/Phalcon/Utils/Slug.php | |
if (!extension_loaded('iconv')) { | |
throw new Exception('iconv module not loaded'); | |
} | |
// Save the old locale and set the new locale to UTF-8 | |
$oldLocale = setlocale(LC_ALL, '0'); | |
setlocale(LC_ALL, 'en_US.UTF-8'); | |
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string); |
# | |
# Nginx proxy for Elasticsearch + Kibana | |
# | |
# In this setup, we are password protecting the saving of dashboards. You may | |
# wish to extend the password protection to all paths. | |
# | |
# Even though these paths are being called as the result of an ajax request, the | |
# browser will prompt for a username/password on the first request | |
# | |
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of |