Skip to content

Instantly share code, notes, and snippets.

@venj
venj / me.venj.checkiPhone.plist
Created November 4, 2011 15:00
Use this plist to set up launchd scheduled task to run this script: https://gist.github.com/1339272
<?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>
<!-- Contains a unique string that identifies your daemon to launchd.
This key is required. -->
<key>Label</key>
<string>me.venj.checkiPhone</string>
@venj
venj / inject.sh
Created December 31, 2011 14:21
Inject F-Script to a named process. This script is based on the Inject F-Script service. Kinda useful when some apps do not provide the standard services menu.
#!/bin/bash
usage() {
echo Usage: `basename $0` Process_Name
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
@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 / ExampleClass.m
Created February 7, 2012 09:10 — forked from lukeredpath/ExampleClass.m
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end
@venj
venj / torrent_spider.rb
Last active September 30, 2015 12:27
!!!!!DEPRECATED!!!!! Tracking the changes to the website is FUCKING BORING!!!! Torrent spider. Hard to maintain...Damn it, always changes web page...
#!/usr/bin/env ruby
# Download torrents from SOME WEBSITE.
require "rubygems"
require "open-uri"
require "hpricot"
require "uri"
require "colorize"
require 'uri'
require 'net/http'
@venj
venj / epubshare_spider.rb
Created February 11, 2012 05:04
Fetch download links from epubshare.com
#!/usr/bin/env ruby
require "rubygems"
require "open-uri"
require "hpricot"
website = "http://www.epubshare.com"
base_uri = "#{website}/page/"
mainpage_index = 1
file = File.open("links.txt", "w+")
@venj
venj / me.venj.mount-hdd-rw.plist
Created April 22, 2012 08:05
mount second hdd noowners
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>me.venj.mount-hdd-rw</string>
<key>ProgramArguments</key>
<array>
<string>mount</string>
@venj
venj / replace-alias-with-link.rb
Created April 22, 2012 09:40
replace aliases with soft links for command line use [ Finder treats links and aliases the same? ]
@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 / apod.rb
Created May 10, 2012 01:58
Download NASA Astronomy Picture Of Day media. (Ruby version)
#!/usr/bin/env ruby
##
# This script will grab NASA's Astronomy Picture of the Day Archive
#
# It will create 2 directories in current directory: big and small
# to save pictures.
#
# Requirements:
# 1. Ruby 1.8.x with Rubygems
# 2. nokogiri gem: (sudo) gem install nokogiri