Skip to content

Instantly share code, notes, and snippets.

View jling90's full-sized avatar

Jun Ling jling90

  • Sydney, Australia
View GitHub Profile
@jling90
jling90 / index.sh
Last active September 30, 2019 07:49
Create react directory
# Creates a index.js, {ComponentName}.jsx, styled/{ComponentName}.js at specified path
# $1 - Path to create files at
# $2 - Component name
# Example usage:
# crdir "src/components/shared" "Foo"
#
# src/components/shared
# |-- index.js, Foo.jsx
# --- styled/
# |--Foo.js
@jling90
jling90 / index.md
Last active May 16, 2017 04:20
random js thot of the day ft. moment.js
var moment = require('moment')
a = moment("2017-05-16")
b = moment("2017-05-17")
c = moment("2017-05-17")

We should always use moment(a).isBefore(b) instead of a < b. Not because the latter does not work (both forms work!); but rather, we might be tempted to assume something like a == b or a === b behaves similarly.

@jling90
jling90 / README.md
Last active February 26, 2016 01:10 — forked from daveallie/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@jling90
jling90 / au.json
Last active August 29, 2015 14:19
tanda open data hackathon playground
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jling90
jling90 / def_dict_ex.py
Created April 17, 2015 05:56
Default dict example
from collections import defaultdict
fruits = [("berry", "strawberry"), ("citrus", "orange"), \
("citrus", "lemon"), ("stone fruit", "nectarine"), \
("berry", "blue berry") ]
# Suppose we want to build a dictionary using the first entry of each tuple as a key...
fruit_dict = {}
for tup in fruits:
def FizzBuzz:
for i in range(1,100):
if not (i % 15):
print "FizzBuzz"
elif not (i % 3):
print "Fizz"
elif not (i % 5):
print "Buzz"
else:
print i
@jling90
jling90 / index.html
Last active August 29, 2015 14:15
This was not intended
<body>
<div id="svgarea"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
text {
font: bold 48px monospace;
}
@jling90
jling90 / COSC3000 Data Visualisation
Last active August 29, 2015 14:00
Source code for the COSC3000 Data Visualisation Project with some commenting and annotations. -- Jun Ling 05/05/14
{
"metadata": {
"name": "",
"signature": "sha256:c55e76093d1a673651f4bc980a841c775224b10a3019a066a7e03105de377bf5"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [