Skip to content

Instantly share code, notes, and snippets.

View hongymagic's full-sized avatar
🤪

David Hong hongymagic

🤪
View GitHub Profile
{
"editor.cursorBlinking": "solid",
"editor.cursorStyle": "block",
"editor.folding": false,
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 18,
"editor.lineHeight": 54,
"editor.lineNumbers": "relative",
"editor.renderIndentGuides": true,
### Roster
Players named in preferred order.
1. flux-
2. never say never
3. arislayer, Trojan
4. crazybrodd
5. Trojan, arislayer, hazrold
@hongymagic
hongymagic / employement_hero_add_timesheet.js
Last active July 11, 2016 03:09
Add timesheet entries into Employement Hero from console
const add_timesheet_entry = (date) => {
const form = {
"utf8": "✓",
"timesheet_entry[created_by]": <your employment hero user id>,
"timesheet_entry[date]": `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`,
"timesheet_entry[start_hm]": "9:00 AM",
"timesheet_entry[end_hm]": "5:00 PM",
"timesheet_entry[units]": "",
"timesheet_entry[member_id]": "<your employment hero user id>",
"timesheet_entry[work_type_id]": "",

React style guide

Follow the normal Javascript style guide - including the 80 character line limit. In addition there are several React-specific rules.

In addition to these style rules, you may also be interested in React best practices.


Syntax

@hongymagic
hongymagic / README.md
Created February 25, 2015 04:11
React.js svg rounded (soft edged) line
@hongymagic
hongymagic / Interval.cs
Last active December 15, 2023 13:09
Representing Intervals in C# with Generics support `Interval<T>`
using System;
namespace Hongy
{
/// <summary>
/// Represents vectorless interval of the form [a, b] or (a, b) or any
/// combination of exclusive and inclusive end points.
/// </summary>
/// <typeparam name="T">Any comparent type</typeparam>
/// <remarks>
@hongymagic
hongymagic / gist:35c6093a7b0b48fb4c4b
Last active August 29, 2015 14:06
found this in ~/, saving it before removing. no idea what it does
//
// Compare two characters
//
// returns 0 if equal, -1 if x is before y, 1 otherwise.
function compareChars(x, y) {
if (x === y) {
return 0;
}
if (x === undefined) {
@hongymagic
hongymagic / curry.js
Last active August 29, 2015 14:05
JavaScript curry and curryRight functions
function apply(handler, args) {
return handler.apply(null, args);
}
function toArray(collection) {
return [].slice.call(collection);
}
function reverse(collection) {
return toArray(collection).reverse();
@hongymagic
hongymagic / 0_reuse_code.js
Created January 18, 2014 13:13
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
@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 = git@stash.internal: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: