Skip to content

Instantly share code, notes, and snippets.

@amiel
amiel / GetBundles.sh
Created April 14, 2011 20:51
How to get GetBundles to work with rvm
#!/bin/bash
if [ `echo -n "$DIALOG" | tail -c 1` != "2" ]; then
CHECK=$("$DIALOG" -l | egrep -c 'TextMate — GetBundles')
else
CHECK=$("$DIALOG" nib --list | egrep -c 'TextMate — GetBundles')
fi
[[ ! -d ~/Library/Logs ]] && mkdir -p ~/Library/Logs
rm -f ~/Library/Logs/TextMateGetBundles.log
@ericbroska
ericbroska / cmm203.mm
Last active December 16, 2015 18:19
Code injection for CleanMyMac 2.0.3. Uses mach_override.
#include <objc/runtime.h>
#import <Security/Security.h>
#import <Security/SecCode.h>
#import <Security/SecRequirement.h>
#include "mach_override.h"
OSStatus CESStaticCodeCreateWithPath (CFURLRef path, SecCSFlags flags, SecStaticCodeRef *staticCode);
OSStatus CESStaticCodeCreateWithPath (CFURLRef path, SecCSFlags flags, SecStaticCodeRef *staticCode)
{
@nriley
nriley / extract.py
Created June 27, 2013 06:51
Extract English subtitle text for WWDC 2013 videos.
import requests
import os, re, sys
RE_SD_VIDEO = re.compile(
r'<a href="(http://devstreaming.apple.com/videos/wwdc/2013/[^"]*-SD.mov)')
RE_WEBVTT = re.compile(r'fileSequence[0-9]+\.webvtt')
# stdin: dump of https://developer.apple.com/wwdc/videos/
for l in sys.stdin:
m = RE_SD_VIDEO.search(l)
@grigio
grigio / Google-Reader-open-source-alternatives.md
Last active July 30, 2021 02:45
Google Reader open source alternatives & features

Here some Google Reader Open Source alternatives with the most expected features.

Please fork and help me to keep it updated.

Name language Database has categories Responsive/Mobile
Commafeed java hsql,mysql/postgresql
Freader nodejs mongodb ???
Goread go appengine
Miniflux php
@XueshiQiao
XueshiQiao / extract.py
Last active April 8, 2018 02:20 — forked from nriley/extract.py
import requests
import os, re, sys
RE_SD_VIDEO = re.compile(
r'<a href="(http://devstreaming.apple.com/videos/wwdc/2013/[^"]*-SD.mov)')
RE_WEBVTT = re.compile(r'fileSequence[0-9]+\.webvtt')
# stdin: dump of https://developer.apple.com/wwdc/videos/
for l in sys.stdin:
m = RE_SD_VIDEO.search(l)
@XueshiQiao
XueshiQiao / wwdc_combine_webvtt.rb
Last active August 21, 2018 00:34
combine WWDC subtitle files (fileSequence*.webvtt) to a srt file.
#!/usr/bin/ruby
docPath = "wwdc_srts"
#exclude . and .. folder
folders = Dir.entries(docPath).select{|folder| folder.to_i > 0}
folders.each{ |folder|
print folder
print "\n"
sequenceFilePath = docPath + "/" + folder

Exploiting Lua 5.1 on 32-bit Windows

The following Lua program generates a Lua bytecode program called ignore-unsigned-sga.fnt, which in turn loads a DLL from within an extremely locked down Lua 5.1 sandbox in a program called RelicCOH2.exe. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
  error("This generator requires a 32-bit version of Lua 5.1")
end

local function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed
anonymous
anonymous / gist:7179097
Created October 27, 2013 08:17
C++ Fast Integer To String Conversion
/*
*****************************************************************************
* The C++ Integer To String Conversion Benchmark *
* *
* This benchmark is based on the solutions provided in the following *
* stackoverflow question: *
* *
* http://stackoverflow.com/q/4351371 (Date: 20101204) *
* *
* Title: C++ Performance Challenge - Integer To std::string Conversion *
anonymous
anonymous / gist:7572848
Created November 20, 2013 23:06
BOOL WINAPI DllMain(HINSTANCE module_handle, DWORD reason_for_call, LPVOID reserved)
{
if (reason_for_call == DLL_PROCESS_ATTACH) // Self-explanatory
{
DisableThreadLibraryCalls(module_handle); // Disable DllMain calls for DLL_THREAD_*
if (reserved == NULL) // Dynamic load
{
foobar_meow(); // Initialize your stuff or whatever
// Return FALSE if you don't want your module to be dynamically loaded
}
@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!