Skip to content

Instantly share code, notes, and snippets.

View christianjunk's full-sized avatar

Christian Junk christianjunk

View GitHub Profile
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| *⌘T* | go to file |
| *⌘⌃P* | go to project |
| *⌘R* | go to methods |
| *⌃G* | go to line |
| *⌘KB* | toggle side bar |
| *⌘⇧P* | command prompt |
@christianjunk
christianjunk / gist:5791842
Last active July 18, 2016 15:18 — forked from andyyou/gist:3052671
Winforms Controls Abbreviation
btn Button chk CheckBox ckl CheckedListBox
cmb ComboBox dtp DateTimePicker lbl Label
llb LinkLabel lst ListBox lvw ListView
mtx MaskedTextBox cdr MonthCalendar icn NotifyIcon
nud NumeircUpDown pic PictureBox prg ProgressBar
rdo RadioButton rtx RichTextBox txt TextBox
tip ToolTip tvw TreeView wbs WebBrowser
容器
flp FlowLayoutPanel grp GroupBox pnl Panel
@christianjunk
christianjunk / rename-tcx.pl
Created June 28, 2013 17:42
Loops through all .tcx/.TCX files in the current directory, and renames them to YYYY-MM-DD-HHMMSS-Sport.tcx, where "Sport" is "Biking", "Other", etc. as in the file.
#!/usr/bin/perl -w
#
# Loops through all .tcx/.TCX files in the current directory, and renames them to YYYY-MM-DD-HHMMSS-Sport.tcx,
# where "Sport" is "Biking", "Other", etc as in the file.
#
# Makes "YYYY/MM" directories and moves the files into them based on their date.
#
# Made as a quick hack, and I hope this is useful for someone.
# Christian Løverås (cl@superelectric.net)
/// <summary>
/// Non-Generic BaseForm. Provides functionality for retrieving the controller.
/// </summary>
public class BaseForm : Form
{
/// <summary>
/// Gets the controller for the given type.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
@echo off
rem
rem Extract Windows 7 x86/x64 language pack
rem
rem 20120324 v1.0 Extract Windows 7 x86/x64 language pack
rem
rem Current working directory where also the language pack executable is located
rem Please don't touch!
@christianjunk
christianjunk / 0_reuse_code.js
Created June 23, 2016 10:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@christianjunk
christianjunk / create-iso.sh
Created March 2, 2017 10:02
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
class PGP
{
public PGP() { }
/**
* A simple routine that opens a key ring file and loads the first available key suitable for
* encryption.
*
* @param in
* @return
@christianjunk
christianjunk / readinglist.py
Last active August 30, 2018 15:02 — forked from mpraglowski/readinglist.py
Export Safari Reading List bookmarks to pinboard
#!/usr/bin/env python
"""
forked from http://alexwlchan.net/2015/11/export-urls-from-safari-reading-list/
Requires Python 3.
"""
import os
import plistlib
INPUT_FILE = os.path.join(os.environ['HOME'], 'Library/Safari/Bookmarks.plist')
@christianjunk
christianjunk / github-to-bitbucket
Last active May 22, 2019 12:33 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v