Skip to content

Instantly share code, notes, and snippets.

@venj
venj / mavericks_bootable_iso.sh
Created July 12, 2016 12:38
Create Bootable ISO from Mavericks App.
#!/usr/bin/env bash
# Original: http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
V_BUILD=/Volumes/install_build
V_APP=/Volumes/install_app
T_SI_B=/tmp/mavericks
T_SI=$T_SI_B.sparseimage
@venj
venj / ipv6-regex-test.sh
Created April 29, 2016 00:29 — forked from syzdek/ipv6-regex-test.sh
Simple script to test my IPv6 regular expression.
#!/bin/sh
#
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])"
posixregex -r "^(${RE_IPV4})$" \
127.0.0.1 \
10.0.0.1 \
192.168.1.1 \
@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
#!/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 / google-chrome-config
Created April 30, 2011 00:45 — forked from mcxiaoke/google-chrome-config
google-chrome-config
#:~/.config/google-chrome/Default/Preferences
# 或 ~/.config/Chromium/Default/Preferences
#在此文件中修改最后一段如下:
"webkit": {
"webprefs": {
"default_fixed_font_size": 16,
"default_font_size": 16,
"fixed_font_family": "DejaVu Sans Mono",
"minimum_font_size": 12,
@venj
venj / delicious2google.rb
Created December 17, 2010 12:23 — forked from toluju/delicious2google.rb
Add a bookmark count for user to check with delicious. Add some line breaks for the out put file to avoid text editor crash if opened by the curious users with a lot of book marks.
require 'net/http'
require 'uri'
require 'cgi'
text = "<html><head><title>Delicious2Google</title></head><body>" +
"<h1>Upload</h1>" +
"<form action='https://www.google.com/bookmarks/mark?op=upload&zx=#{rand(65535)}' method='POST'>" +
"<input type='submit'/><input type='hidden' id='data'></form>" +
"<textarea id='xml' style='display:none'>\n<bookmarks>\n"