Skip to content

Instantly share code, notes, and snippets.

View lkraider's full-sized avatar

Paul Eipper lkraider

View GitHub Profile
@lkraider
lkraider / gist:59254
Created February 6, 2009 06:27
Ubiquity I'm Feeling Lucky google search
/* Based on Royall's original quicky script:
* http://gist.github.com/16507
*/
CmdUtils.CreateCommand({
name: "quicky",
icon: "http://www.google.com/favicon.ico",
homepage: "http://lkraider.eipper.com.br/ubiquity",
author: { name: "Paul Eipper", email: "paul@eipper.com.br"},
license: "GPL",
description: "Perform an I'm Feeling Lucky google search on the preview pane",
@lkraider
lkraider / avcodec_sample.c
Created February 17, 2011 16:37
ffmpeg thumbnailer - extract frame, scale and save it to disk
// avcodec_sample.0.5.0.c
// Original source:
// http://web.me.com/dhoerl/Home/Tech_Blog/Entries/2009/1/22_Revised_avcodec_sample.c.html
//
// A small sample program that shows how to use libavformat and libavcodec to
// read video from a file.
//
// This version is for the 0.4.9+ release of ffmpeg. This release adds the
// av_read_frame() API call, which simplifies the reading of video frames
@lkraider
lkraider / github_cloudfront_disable_ssl.user.js
Created March 20, 2011 06:03
Greasemonkey userscript that removes SSL from Cloudfront hosted assets in GitHub
/*
# README
This userscript is a hack to replace HTTPS Cloudfront hosted assets on GitHub.
Cloudfront serves its files *only* through 128-bit RC4/MD5 encryption, which is
old and not appropriate for secure use in the modern day, and as such I have
that disabled in Firefox (about:config security.ssl3.rsa_rc4_128_md5).
Since there is currently no way to whitelist encryption schemes for specific
+---------------------------+
| o +---+ |
|+-------------------------+|
||.:!3G 13:37 [###]||
||-------------------------||
|| +---+ +---+ +---+ +---+ ||
|| |,O | | 1 | | v | | O | ||
|| +---+ +---+ +---+ +---+ ||
|| Msg Cal Pic Cam ||
@lkraider
lkraider / gist:1115252
Created July 30, 2011 06:02
MWPhotoBrowser
--- a/MWPhotoBrowser.m
+++ b/MWPhotoBrowser.m
@@ -95,7 +95,6 @@
pagingScrollView.backgroundColor = [UIColor blackColor];
pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
pagingScrollView.contentOffset = [self contentOffsetForPageAtIndex:currentPageIndex];
- [self.view addSubview:pagingScrollView];
// Setup pages
visiblePages = [[NSMutableSet alloc] init];
@lkraider
lkraider / adf2mp3.py
Created November 2, 2011 22:40
GTA Vice City ADF to MP3 audio converter
#!/usr/bin/env python
import sys
import os
def adf2mp3(input_path, output_path, buffer_size=1024*1024):
print 'Converting', output_path
input_file = open(input_path, 'rb')
output_file = open(output_path, 'wb')
for read_buffer in iter(lambda: input_file.read(buffer_size), ''):
@lkraider
lkraider / BasicExample.md
Last active December 14, 2015 13:28 — forked from zdne/BasicExample.md

Format: 1A Host: http://blog.acme.com

Basic ACME Blog API

Welcome to the ACME Blog API. This API provides access to the ACME Blog service.


import unittest
import hashlib
from schematics.models import Model
from schematics.types import IntType, StringType, MD5Type
from schematics.exceptions import ValidationError
class TestTransformers(unittest.TestCase):
@lkraider
lkraider / custom_schematics_type.py
Last active December 18, 2015 22:38 — forked from JensRantil/custom_schematics_type.py
Demonstrating the convert -> validate -> primitive structure
#!/bin/env python2.7
from schematics.models import Model
from schematics.types import StringType
from schematics.exceptions import ValidationError
class EventType(StringType):
DIVIDER = ':'
@lkraider
lkraider / async-socket.py
Created August 14, 2014 23:13
Example of using gevent for async socket server and client
import gevent
import gevent.server
import gevent.monkey
gevent.monkey.patch_all()
import socket
import string
import random
import filecmp