Skip to content

Instantly share code, notes, and snippets.

@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
import random
__all__ = ('corpus', 'words', 'lorem')
'''
Simple Lorem Ipsum generator for python with some probabilistic punctuation smarts.
The corpus is the full text of De finibus bonorum et malorum/Liber Primus from wikisource:
http://la.wikisource.org/wiki/De_finibus_bonorum_et_malorum/Liber_Primus
@navinpai
navinpai / remove_9gag_watermark.php
Created May 20, 2012 17:11
Remove watermark/link from 9GAG Images
<?php
// Got bored/bugged of seeing the watermarks/Link at the bottom of 9GAG images. So wrote this script to remove them
// Eg. http://d24w6bsrhbeh9d.cloudfront.net/photo/4216213_700b_v1.jpg
// Very very basic PHP, but gets stuff done!
// Coded while listening to: http://8tracks.com/jkurtis/we-ll-run-wild :D
// USAGE: Put all pics in a 'pics' folder and create an empty 'crop' folder. Run Script. Enjoy. :D
$count=0;
echo "<h6>STARTED</h6>";
foreach(glob('pics/{*.jpg,*.jpeg,*.png}', GLOB_BRACE) as $image)
{
@philfreo
philfreo / gist:7257723
Created October 31, 2013 21:44
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
@drassi
drassi / yooouuutuuube.py
Created January 18, 2014 21:16
Yooouuutuuube emulator, just generates ffmpeg params with python
# Example usage:
# youtube-dl https://www.youtube.com/watch?v=2XY3AvVgDns -o 'beyonce-countdown.mp4'
# python yooouuutuuube.py beyonce-countdown.mp4 beyonce-countdown-party.mp4 --width=1280 --height=720 --split=5 --delay=0.04
# open beyonce-countdown-party.mp4
import os
import sys
def yooouuutuuube(infile, outfile, total_width, total_height, n, delay):
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@NanoDano
NanoDano / extract_pngs.py
Created July 31, 2016 18:23
Extract PNGs from a file using Python
# extract_pngs.py
# Extract PNGs from a file and put them in a pngs/ directory
import sys
with open(sys.argv[1], "rb") as binary_file:
binary_file.seek(0, 2) # Seek the end
num_bytes = binary_file.tell() # Get the file size
count = 0
for i in range(num_bytes):
binary_file.seek(i)
@AgentOak
AgentOak / youtube_formats.md
Last active July 24, 2024 11:20
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
@bagder
bagder / build-log.txt
Created September 12, 2017 12:49
Firefox build problems on Windows 7, mozilla-build 3.0, MSVC 2015, github gecko'dev git master
daniel@daniel-win7 e:/win-src/gecko-dev
$ mach build
c:\mozilla-build\mozmake\mozmake.EXE -f client.mk MOZ_PARALLEL_BUILD=6 -s configure
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "SVE"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Generating e:/win-src/gecko-dev/configure
@hanss314
hanss314 / votecounter.py
Created November 20, 2017 03:32
bfb vote counter
'''
Copyright 2017 hanss314
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: