I hereby claim:
- I am cng on github.
- I am charlieg (https://keybase.io/charlieg) on keybase.
- I have a public key ASDYS0iSzU2DXRIFcr_WM29EwqGxVP328Smd3RgYzs5nbAo
To claim this, I am signing this object:
Trying to do this within Coda 2 -> Preferences -> Editor -> Custom Syntax Modes worked on one computer but gave me an error on another. So for that computer, I did this: | |
Used https://github.com/zenangst/Coda-2-Modes: | |
cd ~/Library/Application\ Support/Coda\ 2 | |
mv Modes Modes.bak | |
git clone git@github.com:zenangst/Coda-2-Modes.git Modes | |
sed -i -e 's/<extension>xml<\/extension>/<extension>xml<\/extension><extension>mtml<\/extension>/' Modes/XML.mode/Contents/Resources/ModeSettings.xml |
<?php | |
$body = <<<EOT | |
<$mt:EntryBody encode_php="here"$> | |
EOT; | |
preg_match_all('#<p>(.+?)</p>#is', $body, $matches); | |
switch(count($matches[0])) { | |
case 0: break; | |
case 1: echo $matches[0][0]; break; | |
case 2: echo $matches[0][0].$matches[0][1]; break; | |
default: echo $matches[0][0]."<p>".$matches[1][1].' <a href="<mt:EntryPermalink>" class="actionlink">Read more »</a>'; break; |
<$mt:Var name="time" value="1"$> | |
<mt:If name="time"> | |
<$mt:Date format="%H" setvar="hours"$> | |
<$mt:Date format="%M" setvar="minutes"$> | |
<$mt:Date format="%S" setvar="seconds"$> | |
<$mt:Var name="hours" op="*" value="3600" setvar="hourseconds"$> | |
<$mt:Var name="minutes" op="*" value="60" setvar="minuteseconds"$> | |
<$mt:Var name="totalseconds" value="$hourseconds"$> | |
<$mt:Var name="totalseconds" op="+" value="$minuteseconds" setvar="totalseconds"$> | |
<$mt:Var name="totalseconds" op="+" value="$seconds" setvar="totalseconds"$> |
<?php | |
$max_age_seconds = 60*10; | |
$json_file = dirname(__FILE__).'/'.pathinfo(__FILE__,PATHINFO_FILENAME).'.json'; | |
$data; | |
if( file_exists( $json_file ) && time() - filemtime( $json_file ) < $max_age_seconds ) { | |
$data = file_get_contents( $json_file ); | |
} else { | |
// Create $data | |
$data = ''; |
<?php | |
error_reporting(E_ERROR | E_PARSE); | |
$dom = new DOMDocument; | |
$dom->loadHTMLFile('http://www.crowdrise.com/jobraising/'); | |
$node = $dom->getElementById('causes_module'); | |
$finder = new DomXPath($dom); | |
$classname="profile"; |
<?php | |
/* | |
USAGE: | |
To request a new token: ?newtoken=please | |
To ask if token is valid: ?token=xamBVbmRlKcSSVsrxt8WEqQ6NdpS7z | |
SETUP: | |
$tokensFilename must be writable by script, preferably in a location outside |
<mt:Ignore> | |
Want to do it like this, but it's outputting all months for every year... | |
http://www.movabletype.org/documentation/appendices/tags/archivelist.html | |
"Here, we're combining two ArchiveList tags (the inner ArchiveList tag is bound to the date range of the year in context)" | |
<mt:ArchiveList type="Yearly"> | |
<mt:ArchiveListHeader><ul></mt:ArchiveListHeader> | |
<li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveDate format="%Y"$></a>: </li> | |
<mt:ArchiveList type="Monthly" sort_order="ascend"> | |
<mt:ArchiveListHeader><li></mt:ArchiveListHeader> |
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
date; | |
cd /var/log/apache2; mkdir combined_error_logs; | |
rsync -a -e ssh root@www1:/var/log/apache2/error* combined_error_logs/www1; | |
rsync -a -e ssh root@www2:/var/log/apache2/error* combined_error_logs/www2; | |
date; | |
cd combined_error_logs/www1; gunzip *.gz; cd ../..; | |
cd combined_error_logs/www2; gunzip *.gz; cd ../..; | |
date; | |
cat combined_error_logs/*/* | sed -r -n 's/^\[(\w+) (\w+ \w+) ..:..:.. (\w+).+/\3 \2 \1/p' | awk '{count[$1]++}END{for(j in count) print j" "count[j]}' FS=: | sort > errors_by_date.$(date +%Y-%m-%d).txt; | |
rm -rf combined_error_logs; |
I hereby claim:
To claim this, I am signing this object: