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
foo.bar(baz, function() { | |
var str = 'something'; | |
}); | |
console.log(str); |
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
#!/usr/bin/python | |
import subprocess | |
import time | |
import datetime | |
while True: | |
# check with pgrep if ffmpeg is running | |
running = subprocess.Popen(['pgrep', 'ffmpeg'], stdout=subprocess.PIPE) | |
pid = running.stdout.read().strip() |
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
Jun 12 18:28:50 psykedelia sm-mta[22561]: r5CFSot1022558: to=<xxxx@gmail.com>, ctladdr=<www-data@xxxx> (33/33), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120405, relay=gmail-smtp-in.l.google.com. [173.194.78.27], dsn=2.0.0, stat=Sent (OK 1371050677 c20si1061092wiv.65 - gsmtp) |
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
Jun 12 18:43:44 psykedelia sm-mta[23759]: r5CFhhKn023756: to=<xxxx@gmail.com>, ctladdr=<www-data@xxxx> (33/33), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120405, relay=gmail-smtp-in.l.google.com. [173.194.78.27], dsn=2.0.0, stat=Sent (OK 1371051570 w7si1097511wie.31 - gsmtp) |
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
output = url + " was posted " + old["timestamp"].strftime("%d.%m.%Y %H:%M:%S") + " by " + old["username"] |
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
#!/usr/bin/python2 | |
import socket | |
import sys | |
import re | |
import time | |
import urllib2 | |
from pymongo import MongoClient | |
from lxml.html import parse |
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
$user = $this->_db->prepare("SELECT username, password FROM users WHERE username=:username LIMIT 1"); | |
$user->bindValue(':username', $this->username); | |
$user->execute(); | |
echo $user->queryString; | |
// "SELECT username, password FROM users WHERE username=':username' LIMIT 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
public function loginUser() { | |
try { | |
$user = $this->_db->prepare("SELECT username, password FROM users WHERE username=:username AND password=:password LIMIT 1"); | |
$user->bindValue(':username', $this->username, PDO::PARAM_STR); | |
$user->bindValue(':password', $this->hashPassword($this->password), PDO::PARAM_STR); | |
$user->execute(); | |
if($user->rowCount() > 0) { | |
return true; | |
} else { | |
return 'ERRNO11'; |
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
regex: \b(ftp|https?):\/\/([a-zA-Z0-9]+\.)?([a-zA-Z0-9äÄöÖ_-]+)(:[0-9]+)?\.([a-z]{2,})([a-zA-Z0-9_%\/\?\#\&\=.-]*)\b | |
match string: so is this something: http://kkoo.h-ost.com:8080/p/a/test-ing/t/h?query=string#hash gahasfdfsa funny | |
matching: http://kkoo.h-ost.com |
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
# There can be multiple urls in a line, handle each of them | |
matchUrl.forEach (u) -> | |
data = {} | |
data.url = u | |
data.nick = from | |
data.channel = to | |
# Get the title of the url if there is any | |
url.getTitle data.url, (err, resp) -> | |
if err |
OlderNewer