This file contains 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 | |
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n |
This file contains 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
Show hidden characters
// Settings in here override those in "Default/Preferences.sublime-settings", | |
// and are overridden in turn by file type specific settings. | |
{ | |
"default_line_ending": "unix", | |
"ensure_newline_at_eof_on_save": true, | |
"fallback_encoding": "UTF-8", | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" |
This file contains 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
// Ref: https://docs.angularjs.org/guide/production#! | |
app.config(['$compileProvider', function ($compileProvider) { | |
// disable debug info | |
$compileProvider.debugInfoEnabled(false); | |
}]); | |
// Enabled back in browser console | |
angular.reloadWithDebugInfo(); |
This file contains 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
US | |
AL|Alabama | |
AK|Alaska | |
AZ|Arizona | |
AR|Arkansas | |
CA|California | |
CO|Colorado | |
CT|Connecticut | |
DC|Dist. Columbia | |
DE|Delaware |
This file contains 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
// -------------------------------------------------- | |
// Flexbox LESS mixins | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// Flexbox display | |
// flex or inline-flex | |
.flex-display(@display: flex) { | |
.old-flex-display(@display); | |
display: ~"-webkit-@{display}"; |
This file contains 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 | |
if [[ -z $1 ]] | |
then | |
echo "Usage: $0 <key>, key: key to delete, e.g. \"mykey*\"" | |
exit 1; | |
fi | |
# does not check if key exists | |
# if key does not exists, you likely get "ERR wrong number of arguments for 'del' command" |
This file contains 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
$ sudo apt-get install -y php-pear | |
$ sudo apt-get install -y build-essential php5-dev | |
$ sudo pecl search zendopcache | |
$ sudo pecl install zendopcache-7.0.3 | |
$ sudo vi /etc/php5/conf.d/opcache.ini | |
$ sudo find / -name 'opcache.so' | |
$ sudo service php5-fpm restart | |
$ sudo service apache2 restart |
This file contains 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 ($) { | |
// IE8 last-child selector | |
Drupal.behaviors.lastChildIE8 = { | |
attach: function (context, settings) { | |
if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) { | |
$('*:last-child').addClass('last-child'); | |
} | |
} | |
}; |
This file contains 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 | |
// Use this to identify possible table needs to be updated | |
// SELECT DISTINCT TABLE_NAME | |
// FROM INFORMATION_SCHEMA.COLUMNS | |
// WHERE COLUMN_NAME IN ('language') | |
// AND TABLE_SCHEMA='<YOUR_DATABASE>'; | |
// include other custom fields | |
$tables = array( |
This file contains 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 | |
# swapused.sh | |
# -- Get current swap usage for all running processes | |
# -- | |
# -- rev.0.4, 2014-04-11, Chin Kiong Ng - sort kb asc | |
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting | |
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output | |
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version |