Skip to content

Instantly share code, notes, and snippets.

@ApprenticeGC
ApprenticeGC / SomePythonFile.py
Created December 15, 2011 03:24
A public gist for testing
print ("This is python script.")
@ApprenticeGC
ApprenticeGC / virtual-box-create-hd.py
Created January 24, 2012 04:13
Partial script to show how to create hd in VirtualBox
commandVBoxManage = 'VBoxManage'
hdSuffixNames = ['boot',
'root',
'tmp',
'var',
'usr',
'usr-local',
'swap',
'home']
@ApprenticeGC
ApprenticeGC / .java-6-oracle.jinfo
Created January 26, 2012 09:22
Download java SE 6 update 30 from Oracle.
name=java-6-oracle
alias=java-6-oracle
priority=63
section=non-free
jre ControlPanel /usr/lib/jvm/java-6-oracle/jre/bin/ControlPanel
jre java /usr/lib/jvm/java-6-oracle/jre/bin/java
jre java_vm /usr/lib/jvm/java-6-oracle/jre/bin/java_vm
jre javaws /usr/lib/jvm/java-6-oracle/jre/bin/javaws
jre jcontrol /usr/lib/jvm/java-6-oracle/jre/bin/jcontrol
@ApprenticeGC
ApprenticeGC / install-jenkins.sh
Created January 26, 2012 10:17
Install Jenkins from apt.
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo aptitude update
sudo aptitude install jenkins
@ApprenticeGC
ApprenticeGC / pythonbrew-install-result-error
Created August 16, 2012 04:00
Result of Installing Pythonbrew without Compiler
Use the previously fetched /Users/apprentice/.pythonbrew/dists/Python-3.2.3.tgz
Extracting Python-3.2.3.tgz into /Users/apprentice/.pythonbrew/build/Python-3.2.3
This could take a while. You can run the following command on another shell to track the status:
tail -f "/Users/apprentice/.pythonbrew/log/build.log"
Installing Python-3.2.3 into /Users/apprentice/.pythonbrew/pythons/Python-3.2.3
./configure --prefix="/Users/apprentice/.pythonbrew/pythons/Python-3.2.3" --with-computed-gotos MACOSX_DEPLOYMENT_TARGET=10.7 --enable-shared
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
@ApprenticeGC
ApprenticeGC / git-merge
Created September 5, 2012 23:43
Grasp Git Command
git merge [-n] [--stat] [--no-commit] [--squash]
[-s <strategy>] [-X <strategy-option>]
[--[no-]rerere-autoupdate] [-m <msg>] [<commit>…]
--no-commit
Perform the merge and commit the result. This option can be used to override --no-commit.
With --no-commit perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and further tweak the merge result before committing.
ours
@ApprenticeGC
ApprenticeGC / Script1-01.applescript
Created October 11, 2012 09:44
AppleScript 1-2-3 Chapter1
tell application "Finder" to close every window
@ApprenticeGC
ApprenticeGC / token-retriever.py
Created October 13, 2012 14:39
Retrieve TestFlight token info
#!/usr/bin/env python
import argparse
from selenium import webdriver
class TokenRetriever:
#
test_flight_link_address = 'https://testflightapp.com/'
#
def __init__(self):
@ApprenticeGC
ApprenticeGC / SomeClassFSharp.fs
Created October 27, 2012 09:18
Unity 3d editor plugin code in F#
namespace Assembly_FSharp_vs
open UnityEditor
open UnityEngine
type public SomeTool() =
inherit UnityEditor.EditorWindow()
//
[<MenuItem("MySelection/Print Selection")>]
static member ShowWindow() = UnityEditor.EditorWindow.GetWindow(typeof<SomeTool>)
@ApprenticeGC
ApprenticeGC / SizeOfFolder01.fs
Created November 3, 2012 06:18
Function Composition Demo
open System.IO
let sizeOfFolderComposed folder =
let getFiles folder =
Directory.GetFiles(folder, "*.*", SearchOption.AllDirectories)
let totalSize =
folder
|> getFiles
|> Array.map (fun file -> new FileInfo(file))