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
#!/bin/bash | |
# From newly installed arch linux image | |
# Based on instructions from | |
# http://www.techrepublic.com/blog/opensource/how-to-create-photo-slideshows-with-as-little-software-as-possible/3716 | |
# update and install requred packages | |
pacman -Syy | |
pacman -S fbida ttf-inconsolata | |
# Set timezone |
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
/* | |
* Test browser support for FirstClass Web Services | |
* Based on http://www.quirksmode.org/js/detect.html | |
* Modified to add this.supported | |
* | |
* Modern web browsers supported: | |
* - Internet Explorer 10 | |
* - Safari 6 and above | |
* - Firefox 16 and above | |
* - Chrome 22 and above |
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
import base64 | |
import requests | |
from pprint import pprint | |
url = "http://api.eventfinder.co.nz/v2/events.json" | |
username = "xxxxx" | |
password = "xxxxx" | |
auth = base64.encodestring('%s:%s' % (username, password)).replace('\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
import BeautifulSoup | |
import requests | |
import subprocess | |
url = "http://eztv.it/shows/385/louie/" | |
html = requests.get(url).text | |
soup = BeautifulSoup.BeautifulSoup(html) | |
links = soup.findAll(title="Magnet Link") |
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
cd c:\windows\system32 | |
net stop vss | |
net stop swprv | |
regsvr32 ole32.dll | |
regsvr32 vss_ps.dll | |
Vssvc /Register | |
regsvr32 /i swprv.dll | |
regsvr32 /i eventcls.dll | |
regsvr32 es.dll | |
regsvr32 stdprov.dll |
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
#!/bin/bash | |
# Create a user.conf | |
cat > /etc/apache2/users/$(whoami).conf <<EOF | |
<Directory "/Users/$(whoami)/Sites/"> | |
Options Indexes MultiViews | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> |
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/php | |
<?php | |
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null) | |
{ | |
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api | |
$url = "https://app.asana.com/api/1.0/$methodPath"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); |
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
import csv | |
# Assumes row 1 of the csv file contains the headers to use as keys | |
def get_csv_data(path): | |
data = [] | |
with open(path, 'rb') as f: | |
reader = csv.reader(f) | |
headers = reader.next() |
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
import requests | |
from bs4 import BeautifulSoup | |
from pprint import pprint | |
url = "http://www.newworld.co.nz/store-map" | |
html = requests.get(url).text | |
soup = BeautifulSoup(html) | |
content = soup.find("div", class_="content") |
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
import requests | |
from bs4 import BeautifulSoup as bs | |
url = "https://www.zomato.com/auckland/bread-butter-bakery-grey-lynn" | |
html = requests.get(url).text | |
soup = bs(html) | |
rating = float(soup.find("div", class_="rating-div").text.strip()) |
OlderNewer