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() { | |
var throttle; | |
$(window).resize(function() { | |
clearTimeout(throttle); | |
throttle = setTimeout(function() { | |
/* resize code */ | |
}, 100); | |
}); |
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 | |
while true | |
do | |
PASSWORD_LENGTH=20 | |
password="$(head -n5 /dev/urandom | strings | tr -c '[:alnum:]' ' ' | tr -d '[:space:]' | cut -b1-$PASSWORD_LENGTH)" | |
[ "$(echo -n "$password" | wc -c)" -ne $PASSWORD_LENGTH ] || break | |
done |
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 | |
# Default parameters | |
OptSortColumn=none | |
OptSortReverse=0 | |
ProxyArguments=() | |
# Parse parameters | |
for param in "$@" | |
do |
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 | |
protected function _getMemoryLimit() | |
{ | |
$memoryLimit = trim(strtoupper(ini_get('memory_limit'))); | |
if (!isSet($memoryLimit[0])){ | |
$memoryLimit = "128M"; | |
} |
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 | |
echo -n "Searching for '$1' in chatsync .. " | |
find "$HOME/Library/Application Support/Skype" -type d -name chatsync -print0 \ | |
| xargs -0 -I{} find {} -type f -name '*.dat' \ | |
| while read syncFile | |
do | |
(strings "$syncFile" | fgrep -qi "$1") \ | |
&& (strings "$syncFile" | less -p"$1") |
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
BEGIN { | |
headerString = "" | |
footerString = "" | |
inactiveCount = 0 | |
split("", inactiveTorrents) | |
activeCount = 0 | |
split("", activeTorrents) | |
} |
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
<!-- Your mixed HTML+PHP page script (pseudo-code) --> | |
<?php mysql_connect(/* database details */) ?> | |
<?php $result = mysql_query(/* get current page from db */) ?> | |
<?php $page = mysql_fetch_assoc($result) ?> | |
<html> | |
<head> | |
<title><?php echo htmlentities($page['title']) ?></title> | |
</head> | |
<body> | |
<h1><?php echo htmlentities($page['title']) ?></h1> |
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 precmd { | |
local SSH_STATUS="" | |
if [ -n "$SSH_CONNECTION" ] | |
then | |
SSH_STATUS="%m " | |
fi | |
PROMPT="${SSH_STATUS}%1~ %B%#%b " | |
} |
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 | |
$structure = array( | |
'html' => array( | |
'children' => array( | |
'head' => array( | |
'children' => array( | |
'title' => array( | |
'children' => array( | |
'Hello, World' |
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
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Acme_Module> | |
<active>true</active> | |
<codePool>local</codePool> | |
</Acme_Module> | |
</modules> | |
</config> |
OlderNewer