Skip to content

Instantly share code, notes, and snippets.

Alyssa Quek alyssaq

Block or report user

Report or block alyssaq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alyssaq
alyssaq / timezone-abbreviations.csv
Last active Jun 28, 2018
Timezone abbreviations to name and UTC offset
View timezone-abbreviations.csv
Abbreviation. Name UTC offset
ACDT Australian Central Daylight Time +10:30
ACST Australian Central Standard Time +9:30
ACT Acre Time -5
ACT Australian Central Time +9:30 / +10:30
ACWST Australian Central Western Standard Time +8:45
ADT Arabia Daylight Time +4
ADT Atlantic Daylight Time -3
AEDT Australian Eastern Daylight Time +11
AEST Australian Eastern Standard Time +10
@alyssaq
alyssaq / static IP to VM.md
Last active Jun 21, 2018
Create a VM in virtualbox with a static IP to allow ssh - ubuntu 16.04 amd64
View static IP to VM.md

Create a host-only network

In the virutal box UI, Global Tools tab > create vboxnet0 host network with DHCP disabled (untick Enable Server).

Create/modify a VM with host-only network

Select the VM (it must be shut down to add a 2nd network adapter) > Settings > Network tab > Adapter 2 > Attach Host-only adapter and vboxnet0

Set static IP in VM (ubuntu 16.04 amd64)

Start the VM.
Edit /etc/network/interfaces

@alyssaq
alyssaq / countries_continents.csv
Last active Mar 21, 2018
country and continent codes
View countries_continents.csv
continent_code country_code continent_name country_name
AS AF Asia Afghanistan
EU AX Europe Åland Islands
EU AL Europe Albania
AF DZ Africa Algeria
OC AS Oceania American Samoa
EU AD Europe Andorra
AF AO Africa Angola
NA AI North America Anguilla
AN AQ Antarctica Antarctica
View gist:8826df9cedbda96da0114c574d668ee8
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import logger from 'redux-logger'
import rootReducer from '../reducers'
import { debounce } from 'lodash'
let prevFilter = ''
function dispatchData(dispatch, data, numRows) {
const allData = data.displayData
@alyssaq
alyssaq / plot.py
Created Nov 2, 2017
Different y scales with datetime x-axis
View plot.py
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import datetime
t = datetime.datetime.now().date()
varr = range(10)
tarr = matplotlib.dates.date2num([t + datetime.timedelta(days=i) for i in varr])
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
View aws-alias.txt
alias aws-get='export instanceId=`aws ec2 describe-instances --filters "Name=instance-state-name,Values=stopped,Name=instance-type,Values=p2.xlarge" --query "Reservations[0].Instances[0].InstanceId" --output text` && echo $instanceId'
alias aws-start='aws ec2 start-instances --instance-ids $instanceId && aws ec2 wait instance-running --instance-ids $instanceId && export instanceIp=`aws ec2 describe-instances --filters "Name=instance-id,Values=$instanceId" --query "Reservations[0].Instances[0].PublicIpAddress" --output text` && echo $instanceIp'
alias aws-ip='export instanceIp=`aws ec2 describe-instances --filters "Name=instance-id,Values=$instanceId" --query "Reservations[0].Instances[0].PublicIpAddress" --output text` && echo $instanceIp'
alias aws-ssh='ssh -i ~/.ssh/aws-ec2.pem ubuntu@$instanceIp'
alias aws-stop='aws ec2 stop-instances --instance-ids $instanceId'
alias aws-state='aws ec2 describe-instances --instance-ids $instanceId --query "Reservations[0].Instances[0].State.Name"'
alias aws-nb='export ins
View bayesian_neural_network.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alyssaq
alyssaq / main.go
Last active Jun 20, 2018
GET and POST golang API
View main.go
/*
* Sample API with GET and POST endpoint.
* POST data is converted to string and saved in internal memory.
* GET endpoint returns all strings in an array.
*/
package main
import (
"encoding/json"
"flag"
@alyssaq
alyssaq / main.go
Last active Oct 18, 2019
GET and POST golang API
View main.go
/*
* Sample API with GET and POST endpoint.
* POST data is converted to string and saved in internal memory.
* GET endpoint returns all strings in an array.
*/
package main
import (
"encoding/json"
"flag"
@alyssaq
alyssaq / README.md
Last active Jan 4, 2016 — forked from jinroh/README.md
Fourier series visualisation with d3.js.
View README.md

From Wikipedia:

In mathematics, a Fourier series decomposes periodic functions or periodic signals into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines (or complex exponentials).

Use the bottom right form to change the visualized series. http://bl.ocks.org/alyssaq/cdc85c326444dc2b0406

You can’t perform that action at this time.