View Android TimeExpiringLruCache.java
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
import java.util.HashMap; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import android.os.SystemClock; | |
public class TimeExpiringLruCache<K, V> { | |
private final LinkedHashMap<K, V> map; | |
private final HashMap<K, Long> validityTime; |
View gist:6281772
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
{ | |
"msg" : "This is gist connection test" | |
} |
View openssl_split_one_pem_to_multiple.sh
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
wget -O - http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}' |
View tar_folder.sh
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
-z: Compress archive using gzip program | |
-c: Create archive | |
-v: Verbose i.e display progress while creating archive | |
-f: Archive File name | |
(this creates archive) | |
tar -zcvf archive_name.tar.gz /home/tom/and/jerry/ | |
View default-mapping.json
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
{ | |
"_default_": { | |
"properties": { | |
"my_hash_field": { | |
"type" : "string", | |
"index" : "not_analyzed" | |
} | |
} | |
} | |
} |
View package.json
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
{ | |
"name": "kibana-server", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node server.js" | |
}, | |
"dependencies": { | |
"express": "3.4.4" | |
} |
View BootstrapFormHelper.php
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 | |
/** | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* | |
* Licensed under The MIT License | |
* | |
* Copyright (c) La Pâtisserie, Inc. (http://patisserie.keensoftware.com/) | |
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | |
*/ | |
App::uses('FormHelper', 'View/Helper'); |
View conf-cc.patch
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
--- conf-cc.old 2014-07-14 12:06:58.270692758 +0000 | |
+++ conf-cc 2014-07-14 12:07:14.837994394 +0000 | |
@@ -1,3 +1,3 @@ | |
-gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings | |
+gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -include /usr/include/errno.h | |
This will be used to compile .c files. |
View centos-daemontools-install.sh
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 | |
func_check_for_root() { | |
if [ ! $( id -u ) -eq 0 ]; then | |
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7 | |
fi | |
} | |
func_check_for_root | |
yum install patch -y |
View sysctl-conf.sh
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 | |
#check if this script is running in su mode | |
func_check_for_root() { | |
if [ ! $( id -u ) -eq 0 ]; then | |
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7 | |
fi | |
} | |
func_check_for_root | |
OlderNewer