Skip to content

Instantly share code, notes, and snippets.

@venj
venj / settings.txt
Created May 8, 2012 01:59
List of currently known URLs in the Settings app
# Via: http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme
List of currently known URLs in the Settings app:
prefs:root=General&path=About
prefs:root=General&path=ACCESSIBILITY
prefs:root=AIRPLANE_MODE
prefs:root=General&path=AUTOLOCK
prefs:root=General&path=USAGE/CELLULAR_USAGE
prefs:root=Brightness
prefs:root=General&path=Bluetooth
@venj
venj / down_video.rb
Created February 6, 2012 16:43
This is a script that helps you download any apple keynote presentation on http://www.apple.com/apple-events/. You can copy any of the keynote broadcast link, pick a resolution and feed to this script, this script will help you download the stream video.
#!/usr/bin/env ruby
#
# Name: Apple keynote stream video downloader
# Author: venj<i[AT]venj.me>
# Date: 2012-09-13
#
# Description:
# This script helps you download apple keynote stream video on
# http://www.apple.com/apple-events/. Video format is TS.
#
@venj
venj / iOS System Fonts.txt
Created August 21, 2011 08:02
iOS System Fonts
American Typewriter:
AmericanTypewriter
AmericanTypewriter-Bold
Apple Color Emoji:
AppleColorEmoji
AppleGothic:
AppleGothic
@venj
venj / domready.js
Created August 6, 2012 07:17
DOM ready, the easiest way. For modern browsers.
document.addEventListener('DOMContentReady', function(){
// DOM ready.
});
@venj
venj / autocapcha.user.js
Created August 28, 2012 02:53
auto input capcha for you.
// ==UserScript==
// @name aotucapcha
// @namespace http://218.90.160.85:9090/bustravelguide/default.aspx
// @description Auto enter capcha
// @include http://218.90.160.85:9090/bustravelguide/default.aspx
// @version 1
// @grant none
// ==/UserScript==
document.addEventListener('DOMContentLoaded', function(){
@venj
venj / split.rb
Created August 25, 2011 13:06
Split a image into two halves.
#!/usr/bin/env ruby
require "fileutils"
(puts "Usage: #{File.basename $0} widthxheight"; exit 0) if ARGV.size != 1
width, height = ARGV[0].split("x").collect(&:to_i)
(puts "Please enter a valid size."; exit 0) if ((width.to_i == 0) or (height.to_i == 0))
half_width = width / 2
FileUtils.cd("images") do
Dir['**/*'].each do |f|
#!/bin/sh
# Change this line to the URI path of the xcode DMG file.
# XCode 3.2.5
#XCODE_PATH="/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg"
# XCode 4
#XCODE_PATH="/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg"
@venj
venj / trans_gif.sh
Created November 1, 2016 03:59
convert video to gif
#!/bin/sh
# Convert video to gif.
if [[ $# -ne 3 ]]; then
echo "Usage: trans_gif source.mp4 target.gif 300"
exit 1
fi
palette="/tmp/palette.png"
filters="fps=15,scale=$3:-1:flags=lanczos"
@venj
venj / com.yourcompany.autossh.plist
Created May 30, 2012 14:39
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>
@venj
venj / jlpt_slack.rb
Created August 18, 2016 03:53
JLPT notifier
#!/usr/bin/ruby
exit(0) if File.exists?('/root/.jlpt_sent')
require 'net/https'
require 'json'
require 'open-uri'
require 'hpricot'
SLACK_URL = "https://hooks.slack.com/services/xxxxx"