Skip to content

Instantly share code, notes, and snippets.

@alyssaq
alyssaq / timezone-abbreviations.csv
Last active February 13, 2024 08:01
Timezone abbreviations to name and UTC offset
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 / main.go
Last active February 13, 2024 08:01
GET and POST golang API
/*
* 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 February 13, 2024 08:01 — forked from jinroh/README.md
Fourier series visualisation with d3.js.

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.

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 / countries_continents.csv
Last active February 13, 2024 08:01
country and continent codes
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
@alyssaq
alyssaq / static IP to VM.md
Last active February 13, 2024 08:01
Create a VM in virtualbox with a static IP to allow ssh - ubuntu 16.04 amd64

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 / HTTP-1-resources-messages.md
Last active February 13, 2024 07:59
Web HTTP fundamentals - What happens when you type a url in the address bar?

HTTP Fundamentals

HTTP Resources and Messages

What happens when you type a url in the address bar?

HTTP Request: URL

http://www.google.com represents a particular resource on the web.
Resources are anything you want to interact with on the web: images, videos, pages, services.

@alyssaq
alyssaq / HTTP-connections.md
Last active February 13, 2024 07:59
HTTP Connections: How does traffic flow through the Internet? What happens in the network layers in a HTTP transaction?

HTTP Fundamentals 2

HTTP Connections

How does traffic flow through the Internet? What happens in the network layers in a HTTP transaction?

Network Layers

HTTP = application layer protocol (OSI 7) - allows applications to communicate over the network. E.g. Web browser to web server (Apache)
HTTP specifications does not mention how messages move across the network and reach the server. That's where lower layer protocols come to play.

@alyssaq
alyssaq / data-structures.md
Last active February 13, 2024 07:59
Data Structure descriptions: Dictionaries, priority queues, sets, graphs, trees

##Dictionaries A set of n records, each identified by one or more key fields.

Problem: Efficiently locate, insert and delete the record associated with any query key q.

Data structures include hash tables, skip lists and balanced/unbalanced binary search trees.

###Representations

@alyssaq
alyssaq / 0_reuse_code.js
Created November 13, 2013 05:18
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