Skip to content

Instantly share code, notes, and snippets.

import requests
import shutil
divids = ['101', '102', '103', '104', '105', '106', '107', '108', '109', '111', '112', '113', '114', '115', '117',
'118', '119', '120', '121', '122', '124', '125', '126', '127', '128', '130', '131', '132', '133', '134',
'135', '136', '137', '138', '139', '140', '144', '145', '146', '148', '149', '150', '151', '152', '153',
'155', '156', '157', '158', '159', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169',
'170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '180', '182', '183', '185', '186',
'187', '188', '189', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '200', '201',
'203', '204', '205', '207', '208', '209', '210', '211', '212', '213', '214', '215', '216', '217', '218',
@tcg
tcg / eyed3.py
Created May 17, 2013 15:51
Use eyed3 in python to get audio encoding information (bitrate, sample rate, channel mode)
# pip install eyeD3
import eyed3
from eyed3 import mp3
f = mp3.Mp3AudioFile('2-297a587f40fdc0064c44f2e5247d7bf7.mp3')
# Now:
# >>> f.info.sample_freq
# 24000
# >>> f.info.bit_rate
@rizalp
rizalp / JavaScript Sieve Of Atkin.js
Created May 3, 2013 11:49
return array of primes below limit using Sieve of Atkin Algorithm http://en.wikipedia.org/wiki/Sieve_of_Atkin #JavaScript #primes
function sieveOfAtkin(limit){
var limitSqrt = Math.sqrt(limit);
var sieve = [];
var n;
//prime start from 2, and 3
sieve[2] = true;
sieve[3] = true;
for (var x = 1; x <= limitSqrt; x++) {
@wilson0x4d
wilson0x4d / gist:5506778
Created May 3, 2013 02:14
Here is the code for "PS3 Emulator" from "http://hackingnation.org/ps3-emulator/" ~ Yes, it's fake. Yes, the "update" is a malware pushing, cardjacking website.
[DesignerGenerated]
public class Form1 : Form
{
// Fields
[AccessedThroughProperty("AboutToolStripMenuItem")]
private ToolStripMenuItem _AboutToolStripMenuItem;
[AccessedThroughProperty("AudioToolStripMenuItem")]
private ToolStripMenuItem _AudioToolStripMenuItem;
[AccessedThroughProperty("CloseToolStripMenuItem")]
private ToolStripMenuItem _CloseToolStripMenuItem;
@enjalot
enjalot / cors_server.py
Created June 10, 2012 06:19
Allow CORS with python simple http server
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
@kofemann
kofemann / adler32.py
Last active October 15, 2021 07:57
A script to calculate adler32 checksum of given files
#!/usr/bin/env python
'''A script to calculate adler32 checksum of given files'''
BLOCKSIZE=256*1024*1024
import sys
from zlib import adler32
for fname in sys.argv[1:]:
asum = 1
with open(fname,"rb") as f:
@revolunet
revolunet / extractGifs.py
Created March 1, 2011 09:48
extract frames from animated gif using python+PIL
import os
from PIL import Image
def extractFrames(inGif, outFolder):
frame = Image.open(inGif)
nframes = 0
while frame:
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
nframes += 1