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
javascript:(function(){var%20syntaxHighlight=function(json){json=json.replace(/%26/g,'%26amp;').replace(/%3C/g,'%26lt;').replace(/%3E/g,'%26gt;');return%20json.replace(/(%22(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\%22])*%22(\s*:)%3F|\b(true|false|null)\b|-%3F\d+(%3F:\.\d*)%3F(%3F:[eE][+\-]%3F\d+)%3F)/g,%20function%20(match)%20{var%20cls='number';if(/^%22/.test(match))%20{if(/:$/.test(match)){cls='key';}else{cls='string';}}else%20if(/true|false/.test(match)){cls='boolean';}else%20if(/null/.test(match)){cls='null';}return%20'%3Cspan%20class=%22'%20+%20cls%20+%20'%22%3E'+match+'%3C/span%3E';});};var%20xhr=new%20XMLHttpRequest();var%20params=%22url=%22+encodeURIComponent(document.location.toString())+%22%26content=%22+encodeURIComponent(document.documentElement.innerHTML);xhr.open(%22POST%22,%22https://staging.trycurio.com/extractor/check%22,true);xhr.setRequestHeader(%22Content-Type%22,%22application/x-www-form-urlencoded%22);xhr.onreadystatechange=function(){if(this.readyState==4%20%26%26%20this.status==200){var%20temp=do |
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 logging | |
import re | |
import urlparse | |
import requests | |
class Resolver: | |
re_canonical = re.compile('<link rel=[\'\"]canonical[\'\"] href=[\'\"](.*?)[\'\"]', re.IGNORECASE) |
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 cookielib | |
import gzip | |
import httplib | |
import StringIO | |
import urllib | |
import urllib2 | |
class SmartRedirectHandler(urllib2.HTTPRedirectHandler): | |
def http_error_301(self, req, fp, code, msg, headers): | |
result = urllib2.HTTPRedirectHandler.http_error_301( |
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
require 'rubygems' | |
require 'oauth' | |
require 'yaml' | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
def get_access_token | |
p "get_access_token: Initializing Consumer" | |
consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, { |
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
PROJECT_NAME='PROJECT_NAME' | |
MYSQL_HOST='localhost' | |
MYSQL_DB='website' | |
MYSQL_USERNAME='root' | |
MYSQL_PASS='toor' | |
wc_rev=`svn info | grep "Revision" | cut -d ' ' -f2` | |
backup_stamp=$PROJECT_NAME'-'`date +"%d-%m-%Y_%H-%M"`'-r'$wc_rev'.sql' |
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 | |
# Usage: twitlinesender.py <lines.txt> | |
API_URL="http://api.twitter.com/1" | |
API_USER="YOUR_TWITTER_USERNAME" | |
API_PASSWORD="YOUR_TWITTER_PASSWORD" | |
value=`cat $1 | head -n 1` | |
encoded_value=`python -c "import urllib; print urllib.quote('''$value''')"` |
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 | |
# A simple scripts that takes away the pain of creating VirtualHosts on my home Ubuntu server w/ Apache2 | |
# by Arseniy Ivanov, freeatnet.com | |
WWW_ROOT='/var/www/' | |
SITE_CONFS='/etc/apache2/sites-available/' | |
host_name='' |
NewerOlder