Skip to content

Instantly share code, notes, and snippets.

View hongymagic's full-sized avatar
🤪

David Hong hongymagic

🤪
  • Commonwealth Bank of Australia
  • Sydney, Australia
  • 23:44 (UTC +10:00)
View GitHub Profile
@hongymagic
hongymagic / pr.md
Last active December 15, 2017 09:50 — forked from piscisaureus/pr.md
Checkout pull-requests from Atlassian Stash without adding remote

Locate the section for your stash remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:private/repository.git

Now add the line fetch = +refs/pull-requests/*:refs/remotes/origin/pull-requests/* to this section. Obviously, change the stash url to match your project's URL. It ends up looking like this:

@hongymagic
hongymagic / jsbin.UWEpoT.css
Created August 18, 2013 03:34
Trying to modify _content_ of a _content-less_ element – can't be done boys and girls.
html {
font-size: 100%;
}
img,
button,
input {
-webkit-appearance: none;
display: block;
@hongymagic
hongymagic / jsbin.exOreSO.html
Created August 18, 2013 01:51
Working with Dates in Backbone.Model
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.io/backbone/backbone-min.js"></script>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<script src="http://marionettejs.com/downloads/backbone.marionette.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
@hongymagic
hongymagic / dabblet.css
Created April 17, 2013 01:19
Buttons, buttons, buttons for scrooge!
/**
* Buttons, buttons, buttons for scrooge!
*/
@import url(http://fonts.googleapis.com/css?family=Oswald);
button, label {
font-family: 'Oswald', Helvetica, Arial;
font-size: 100%;
line-height: normal;
@hongymagic
hongymagic / README.md
Last active December 16, 2015 02:29
Discussion on EpicEditor.getSelection API

What are the goals for EpicEditor#getSelection API?

  1. Support insertion, modification and deletion of markdown document
  2. Support entire markdown syntax, possibly more (i.e., github style)
  3. Easy and intuitive, duh
  4. Ability to extend, shrink selection range. I.e., manipulate selection programmatically (not included in this document yet)

Implementation

In my view, there are two ways to go about this problem. The first, is to provide a low-level text editing platform which users can use to implement their own functions to perform three operations outlined above. Second, is to provide a markdown specific API.

@hongymagic
hongymagic / issue7.txt
Created April 8, 2013 01:32
grunt-coffeeify> grunt --no-color --debug > issue7.txt
Running "jshint:all" (jshint) task
[D] Task source: /Users/davidhong/Github/grunt-coffeeify/node_modules/grunt-contrib-jshint/tasks/jshint.js
>> 3 files lint free.
Running "clean:tests" (clean) task
[D] Task source: /Users/davidhong/Github/grunt-coffeeify/node_modules/grunt-contrib-clean/tasks/clean.js
Cleaning "tmp"...OK
Running "coffeeify:default_options" (coffeeify) task
[D] Task source: tasks/coffeeify.js
@hongymagic
hongymagic / next.litcoffee
Last active December 14, 2015 22:19
Increment all the strings!

Simple alphabet based sequencer. The first item is always 'a', then

increments by counting the alphabet.

Therefore in this system, we can treat 'a' as minimum and 'z' as the maximum.

BASE = 'a'.charCodeAt 0
MIN = 0
MAX = 25
@hongymagic
hongymagic / Backbone.Model.js
Last active July 1, 2016 03:34
Turn Backbone.Model accessor methods into property getters/setters. Trash the `get()` and `set()` and use it directly!
(function (Backbone) {
var _old = Backbone.Model;
// Take a Backbone.Model and introduce a proper set of accessors based on
// `defaults`. Instead of having to use accessor methods like `get` and
// `set`, just accesss your model properties:
//
// var user = new User();
// user.name = 'David';
@hongymagic
hongymagic / README.md
Last active December 12, 2015 10:29
Australian Taxable Income for year 2009-10 sorted by Occupation

List of occupations and their taxable incomes for financial year 2009-10. This graph was generated as part of my quest to learn d3.js in more detail. My next aim is to fork this gist, and understand what is happening behind the scenes.

Data provided by ATO.

@hongymagic
hongymagic / paris.md
Created December 4, 2012 22:20
Paris Itinerary