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 | |
/** | |
* This script will allow the export of complete user time-lines from the twitter | |
* service. It joins together all pages of status updates into one large XML block | |
* that can then be reformatted/processed with other tools. | |
* | |
* @since 10/13/08 | |
* | |
* @copyright Copyright © 2008, Adam Franco | |
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) |
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
import android.accounts.Account; | |
import android.accounts.AccountManager; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.content.SharedPreferences.Editor; | |
import android.os.Build; | |
import android.preference.PreferenceManager; | |
public final class AccountUtils { |
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
/ip firewall | |
dst-nat protocol=tcp dst-port=80 Action dst-nat to-address=20.20.20.45 to-ports=80 | |
add action=dst-nat chain=dstnat comment="" disabled=no dst-port=80 protocol=tcp to-addresses=20.20.20.45 to-ports=80 | |
#Creating pppoe interface and ADSL internet connection | |
/ interface pppoe-client | |
add name="pppoe-out1" max-mtu=1480 max-mru=1480 interface=ether5 \ | |
user="USERNAMEl" password="PASSWORD" profile=default \ |
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/local/bin/perl | |
# | |
# CC-Verify script for Visa, MasterCard, Amex and Novus Cards | |
# Written 29 June 1996 by Spider ([email protected]) | |
# http://w3works.com | |
# http://www.servtech.com/public/spider | |
# | |
# Loosely based on a re-post of original by Melvyn Myers | |
# (initial author unknown) but this revision covers all 13, | |
# 15 and 16 digit cards using the Mod 10 algorithm. |
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 | |
require_once('assembla.plugin'); | |
$key = '...'; //this is your assembla space id | |
$username = '...'; //this is an assembla user account name | |
$password = '...'; //this is the password for the above user | |
$A = new Assembla($key, $username, $password); | |
//$tickets = $A->listTickets(); |
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
if (!Util) { | |
var Util = {}; | |
} | |
Util.ResourceManager = function(culture, resourcePath) | |
{ | |
this.createResObj(culture, resourcePath); | |
} | |
Util.ResourceManager.prototype = |
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
#!/bin/bash | |
cd /path/to/backup/directory | |
for file in *.tgz | |
do | |
name=${file%%[.]*} | |
echo $name | |
if [ $name = $current_backup_name ] | |
then | |
# do new backup here | |
# delete older one here |
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
import re, random | |
def shuffle_one(word): | |
if len(word) <= 3: | |
return word | |
middle = list(word[1:-1]) | |
random.shuffle(middle) | |
return word[0] + ''.join(middle) + word[-1] |
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
Since you use JSONP, you should code it like this IMHO : | |
$.ajax(URL, { | |
crossDomain:true, | |
dataType: "jsonp", | |
success:function(data,text,xhqr){ | |
$.each(data, function(i, item) { | |
alert(item); | |
}); | |
} |
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/perl -w | |
use strict; | |
while (my $line=<>) { | |
my ($date, $host, $url_with_method, $status, $size, $referrer, $agent) = $line =~ | |
m/^\S+\s+\S+\s+\[(\S+\s+[\-|\+]\d{4})\]\s+(\S+)\s+\S+\s+\S+\s+\S+\s+\S+\s+"(\S+\s+\S+\s+[^"]+)"\s+(\d{3})\s+\S+\s+(\d+|-)\s+\d+\s+\d+\s+\d+\s+"(.*?)"\s+"(.*?)"/; | |
# Print relevant bits | |
} |