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
CmdUtils.CreateCommand( | |
{ | |
name : "delicious", | |
author: { name : "Tonetheman", homepage: "http://tryexceptfinally.blogspot.com"}, | |
license: "MPL", | |
execute : function() { | |
var doc = Application.activeWindow.activeTab.document; | |
var updateUrl = "https://api.del.icio.us/v1/posts/add"; | |
var updateParams = { | |
url: doc.documentURI, |
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 win32api | |
import win32security | |
import win32process | |
import pywintypes | |
def attempt_to_logon(): | |
username = "junk" | |
password = "junk" | |
try: | |
hUser = win32security.LogonUser(username, None, |
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 sys | |
while True: | |
next_line = sys.stdin.readline() | |
if not next_line: | |
break | |
# do something to the line | |
next_line = next_line.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
import java.net.*; | |
import java.io.*; | |
class urllib { | |
public static StringBuffer urlopen(String url) { | |
try { | |
URL u = new URL(url); | |
StringBuffer sb = new StringBuffer(); | |
BufferedReader in = new BufferedReader( |
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
/* | |
* Copyright 2006 ThoughtWorks, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 | |
# tell me about this flv | |
# ffmpeg -i inputvideo.flv | |
# set the bit rate with this command | |
# ffmpeg -i inpuvvideofile.flv -ab 128k outputaudiofile.mp3 | |
# no re encode with this command | |
/usr/bin/ffmpeg -i $1 -acodec copy $1.mp3 |
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
#include <iostream> | |
#include <signal.h> | |
#include <getopt.h> | |
using namespace std; | |
char * __PORT = 0; | |
int PORT = -1; | |
void dbg(const char * 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
#include <iostream> | |
#include <cstring> | |
using std::cout; | |
using std::endl; | |
// convert string to double old school | |
double convert(char * s) { | |
int i=0; | |
double intPart = 0, fracPart = 0; |
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 java.util.Random; | |
public class Shuffler { | |
public static Random r = new Random(); | |
public static void swap(int[] a, int i, int s) { | |
int tmp = a[i]; | |
int tmp2 = a[s]; |
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 time | |
import struct | |
import socket | |
import hashlib | |
import sys | |
from select import select | |
import re | |
import logging | |
from threading import Thread | |
import signal |
OlderNewer