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
-(NSDictionary *)readDatafile:(NSString *)plistfile { | |
NSLog(@"Reading PLIST file %@", plistfile); | |
return [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:plistfile ofType:@"plist"]]; | |
} |
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
def countwordsInString(string, delimiter, word): | |
occurs = 0 | |
stringarray = string.split(delimiter) | |
for stringword in stringarray: | |
if word == stringword: | |
occurs = occurs + 1 | |
return occurs |
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 | |
function countwordsInString($string, $delimiter, $word) { | |
$occurs = 0; | |
foreach (explode($delimiter, $string) as $stringword) if ($word == $stringword) $occurs++; | |
return $occurs; | |
} | |
?> |
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 | |
foreach (scandir("Downloads") as $f) if ((substr($f, -3, 3) == "txt" || substr($f, -3, 3) == "csv") && stristr(strtolower($f), "errors")) echo $f."\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
perl -pi -e "s/\r\n/\n/" $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
<?php | |
$memcache = new Memcache; | |
$memcache->connect('a.b.c.d', 11211); | |
$memcache->set('test', 'This could be an array or an object (the methods wont get saved!', false, 600); | |
$retrieval = $memcache->get('test'); | |
if ($retrieval) print_r($retrieval); | |
?> |
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
Set fso = CreateObject(Scripting.FileSystemObject) | |
Set f = fso.GetFile("Path\to\file") | |
MsgBox CLng(DateDiff("s", f.DateLastModified, Now)) |
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 | |
foreach ($cmds as $cmd) { | |
$pid=pcntl_fork(); | |
if ($pid) { | |
exec($cmd); | |
break; | |
} | |
} | |
?> |
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
for($a=1;$a<=11;$a++){if($a==1){print "h";}elsif($a==2){print "e";}elsif($a==3 or $a==4 or $a==10){print "l";}elsif($a==5 or $a==8){print "o";}elsif($a==11){print "d";}elsif($a==7){print "w";}elsif($a==9){print "r";}else{print " ";}} |
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 | |
// Found this on the web | |
// Requirements: PHP + COM + Win32 (duh) | |
// DISCLAIMER: Found this on the web. Have not tested this yet, but it would come in handy | |
$qcurl =$_GET["qcurl"]; | |
$usr =$_GET["usr"]; | |
$pwd =$_GET["pwd"]; | |
$dmn =$_GET["dmn"]; |
OlderNewer