View isMobile.js
1 2 3 4 5 6 7 8 9 10
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
View socks.txt
1 2 3 4 5 6 7 8 9
From: http://www.chromium.org/developers/design-documents/network-stack/socks-proxy
 
To configure chrome to proxy traffic through the SOCKS v5 proxy server myproxy:8080, launch chrome with these two command-line flags:
 
--proxy-server="socks5://myproxy:8080"
--host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE myproxy"
 
The first thing to check when debugging is look at the Proxy tab on about:net-internals, and verify what the effective proxy settings are:
chrome://net-internals/#proxy
View config.sh
1 2 3 4 5 6 7 8 9 10
Host example.com *.example.net
User root
Host dev.example.net dev.example.net
User shared
Port 220
Host test.example.com
User root
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
Host t
View ssh-reagent.sh
1 2 3 4 5 6 7 8 9 10
ssh-reagent () {
for agent in /tmp/ssh-*/agent.*; do
export SSH_AUTH_SOCK=$agent
if ssh-add -l 2>&1 > /dev/null; then
echo Found working SSH Agent:
ssh-add -l
return
fi
done
echo Cannot find ssh agent - maybe you should reconnect and forward it?
View ifValid.js
1 2 3 4 5 6 7 8 9 10
function ifValid(str)
{
if(str !== "" && str !== 0 && str !== '0' && str !== false && str !== 'false' && str !== 'undefined' && str !== undefined && str !== null)
{
return true;
}
else
{
return false;
}
View queryStringToObject.js
1 2 3 4 5 6 7 8 9 10
// Please note: These cannot handle complex query strings! Just simple ones in the form ?x=y&foo=bar
// Ideal for use with location.search
 
function queryStringToObject(str)
{
var obj = {}; var str = decodeURI(str);
 
str.replace(/([^?=&]+)=([^&]*)/g,function(match, key, value){obj[key] = value;});
 
return obj;
View boostrap-3-media-queries.css
1 2 3 4 5 6 7 8 9 10
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
 
/* Small devices (tablets, 768px and up) */
/* Less: @media (min-width: @screen-sm-min) { ... } */
@media (min-width: 768px) { }
 
/* Medium devices (desktops, 992px and up) */
/* Less: @media (min-width: @screen-md-min) { ... } */
@media (min-width: 992px) { }
View JSONPath.js
1 2 3 4 5 6 7 8 9 10
/* JSONPath 0.8.0 - XPath for JSON
*
* Copyright (c) 2007 Stefan Goessner (goessner.net)
* Licensed under the MIT (MIT-LICENSE.txt) licence.
*/
function jsonPath(obj, expr, arg) {
var P = {
resultType: arg && arg.resultType || "VALUE",
result: [],
normalize: function(expr) {
View copy-or-merge.js
1 2 3 4 5 6 7 8 9 10
obj = {'a':'b'};
obj2 = {'x':'y'};
var copy = JSON.parse(JSON.stringify(obj)); // Really fast! - copies original obj
 
copy['c'] = 'd';
 
console.log(obj); // Outputs: {'a':'b'}
console.log(copy); // Outputs: {'a':'b', 'c':'d'}
 
var merge = $.extend(true, obj, obj2); // Uses jQuery - changes original obj
View README.md

From StackOverflow: http://stackoverflow.com/a/11836108/1365289

if (extension != "jpg" && 
    extension != "gif" && 
    extension != "bmp" && 
    extension != "png" && 
    extension != "whatever else") {
    // This will execute when the extension is NOT one of the expected 
    // extensions.
}
Something went wrong with that request. Please try again.