This file contains hidden or 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 | |
if(stristr($_SERVER['HTTP_USER_AGENT'], ' MSIE 9')){ | |
$msie_post = file_get_contents("php://input"); | |
parse_str($msie_post, $_POST); | |
} |
This file contains hidden or 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 | |
$lockfile = '/tmp/cron_mylongrunningstuff.lock'; | |
if(file_exists($lockfile)){ | |
echo 'Hey, another process is already running, lockfile: '.$lockfile."\n"; | |
exit(0); | |
}else{ |
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
import sys | |
import datetime | |
import time | |
import logging | |
try: | |
import MySQLdb as db |
This file contains hidden or 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
#!/usr/bin/env python | |
import pika | |
import time | |
credentials = pika.credentials.PlainCredentials('guest', 'guest') | |
parameters = pika.ConnectionParameters( | |
host="127.0.0.1", | |
credentials=credentials) | |
connection = pika.BlockingConnection(parameters) | |
channel = connection.channel() |
This file contains hidden or 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
# hämta ut en array med dina likeade urlar | |
if($urls){ | |
foreach($urls as $url){ | |
# fetch stats from fb | |
$fbdata = @json_decode($this->curl->simple_get('http://api.facebook.com/restserver.php?method=links.getStats&urls='.$url.'&format=json')); | |
$likes = $fbdata ? $fbdata[0]->total_count : 0; | |
# uppdatera denna marker med hur många likes den har i databasen. nya värdet på likes finns i: $likes |
This file contains hidden or 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
stoppa in detta i ditt tweetdeck under preferences > global filter. | |
#melo2012, #mel2012, #dif, #twittboll, #mel12012, #melodifestivalen, #mel2012, #melfest, #mel21012, #melfest2012, melodifestivalen, sean banan, ranelid, flinck |
NewerOlder