Skip to content

Instantly share code, notes, and snippets.

View level09's full-sized avatar
🌴
Always on vacation

Nidal Alhariri level09

🌴
Always on vacation
View GitHub Profile
@level09
level09 / gist:4243582
Created December 9, 2012 06:24
python selenium example
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Chrome()
browser.get('http://www.google.com')
print browser.title
browser.quit()
display.stop()
@level09
level09 / gist:4167393
Created November 29, 2012 07:33
outgoing soap
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<GetFullAssetList SOAP-ENC:root="1">
@level09
level09 / gist:4144961
Created November 25, 2012 19:39
incoming
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetFullAssetListResponse
xmlns="/MSAssetControl"><GetFullAssetListResult><FullMSAsset><Asset><id>20121125_1300</id><uploadDate>11/25/2012
14:42</uploadDate><mediaFileUrl>http://77.246.47.132/MediaSphere/mediaFiles/20121125_1300.mp4</mediaFileUrl><description>1300GMT</description><canDelete>true</canDelete><thumbImgUrl>http://77.246.47.132/MediaSphere/mediaFiles/thumbs/20121125_1300.jpg</thumbImgUrl><startTime>11/25/2012
14:42</startTime><endTime>11/25/2012
14:42</endTime><viewedCount>0</viewedCount><RecordingDevice>1300GMT</RecordingDevice><partition
/><mediaRTSPUrl /><mediaHLSUrl /></Asset><AssetText0>&lt;root&gt;&lt;segment
start=&quot;0.000&quot; end=&quot;11.580&quot;&gt;[إعلان]&lt;/segment&gt;&lt;segment
start=&quot;11.580&quot; end=&quot;18.700&quot;&gt;[موسيقى]&lt;/segment&gt;&lt;segment
@level09
level09 / gist:4144906
Created November 25, 2012 19:31
soap response
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetFullAssetListResponse xmlns="/MSAssetControl"><GetFullAssetListResult><FullMSAsset><Asset><id>20121125_1300</id><uploadDate>11/25/2012 14:42</uploadDate><mediaFileUrl>http://77.246.47.132/MediaSphere/mediaFiles/20121125_1300.mp4</mediaFileUrl><description>1300GMT</description><canDelete>true</canDelete><thumbImgUrl>http://77.246.47.132/MediaSphere/mediaFiles/thumbs/20121125_1300.jpg</thumbImgUrl><startTime>11/25/2012 14:42</startTime><endTime>11/25/2012 14:42</endTime><viewedCount>0</viewedCount><RecordingDevice>1300GMT</RecordingDevice><partition /><mediaRTSPUrl /><mediaHLSUrl /></Asset><AssetText0>&lt;root&gt;&lt;segment start=&quot;0.000&quot; end=&quot;11.580&quot;&gt;[إعلان]&lt;/segment&gt;&lt;segment start=&quot;11.580&quot; end=&quot;18.700&quot;&gt;[موسيقى]&lt;/segment&gt;&lt;segment start=&quot;18.700&quot; end=&quot;25
@level09
level09 / gist:4144861
Created November 25, 2012 19:21
outgoing
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<GetFullAssetList SOAP-ENC:root="1">
@level09
level09 / gist:3818159
Created October 2, 2012 10:55
Essential Libraries for python
django
django-celery
django-redis
django-redis-cache
django-redis-sessions
mysql-python
fabric
pil
scrapy
@level09
level09 / gist:3297276
Created August 8, 2012 18:22
download from iNEWS
from ftplib import FTP
import ftplib
output = 'temp'
def download(block):
open(output,'w').write(block)
print ".",
@level09
level09 / rebuild_permissions
Created July 21, 2012 12:02
Drush: rebuild permissions table using command line in Drupal
drush php-eval 'node_access_rebuild();'
@level09
level09 / gist:2965229
Created June 21, 2012 11:28
iOS Run a task in background with a callback
dispatch_queue_t queue = dispatch_queue_create("yourname", NULL);
// execute a task on that queue asynchronously
dispatch_async(queue, ^{
//Code to execute here
dispatch_async(dispatch_get_main_queue(), ^{
// Callback on the main thread when code above is done
@level09
level09 / redis-server.plist
Created May 22, 2012 11:50
Luanchd configuration for redis
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>redis-server</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/redis-server</string>
</array>