Skip to content

Instantly share code, notes, and snippets.

@sweemeng
sweemeng / pulausubang_batucaves.csv
Created June 8, 2018 01:45
KTM Komuter schedule from Pulau Sebang to Batu Caves
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 47 columns, instead of 41. in line 5.
PULAU SEBANG - BATU CAVES,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
NO.TREN / TRAIN NUMBER,22422006,2008,2244,2010,2012,2014,2016,2246,2018,2020,2022,2024,2026,2028,2248,2030,2032,2034,2036,2038,2040,2042,2044,2250,2046,2252,2048,2050,2052,2254,2054,2056,2058,2060,2062,2064,2066,2068,2070,2256,2072,2074,2076,2258,2078,
PULAU SEBANG,,,05:15,,,05:58,,,,07:00,,,08:13,,09:10,,,,10:55,,,,12:55,,,,,,,15:25,,,16:25,,,17:25,,,18:27,,,,19:25,,,20:45
REMBAU,,,05:32,,,06:15,,,,07:17,,,08:30,,09:27,,,,11:12,,,,13:12,,,,,,,15:42,,,16:42,,,17:42,,,18:44,,,,19:42,,,21:02
SUNGAI GADUT,,05:25,05:45,,06:00,06:28,06:45,07:01,,07:30,07:53,08:05,08:43,09:05,09:40,,10:25,10:55,11:25,12:10,12:25,12:55,13:25,13:55,,14:20,,14:55,15:25,15:55,,16:30,16:55,17:15,17:35,17:55,18:15,18:35,18:57,19:15,,19:37,19:55,20:25,,21:15
SENAWANG,,05:31,05:51,,06:06,06:33,06:51,07:07,,07:36,07:59,08:11,08:49,09:11,09:46,,10:31,11:01,11:31,12:16,12:31,13:01,13:31,14:01,,14:26,,15:01,15:31,16:01,,16:36,17:00,17:21,17:40,17:59,18:20,18:41,19:03,19:21
@sweemeng
sweemeng / malaysia_state_size.json
Last active May 25, 2018 03:27
Sparql to get size malaysia state #PerlisIsSoSmall
{"Sarawak": 124450, "Kedah": 9427, "Penang": 1031, "Negeri Sembilan": 6686, "Perlis": 821, "Kelantan": 15099, "Selangor": 8104, "Sabah": 76115, "Johor": 19210, "Malacca": 1664, "Terengganu": 12955, "Pahang": 35964, "Perak": 21035}
@sweemeng
sweemeng / input_data.py
Created April 5, 2018 14:13
Multilayer model for mnist data. Based on the book Fundamentals of Deep Learning
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@sweemeng
sweemeng / input_data.py
Created April 4, 2018 14:01
My first implementation of logistic regression model for mnist, based on the code on Fundamentals of Deep Learning
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@sweemeng
sweemeng / cidb_popit_api.py
Created March 30, 2018 02:59
Just a simple hugs implementation
import hug
import sqlite3
@hug.get()
@hug.local()
def director(popit_id: hug.types.text):
db = sqlite3.connect("popit_cidb.db")
cursor = db.cursor()
cursor.execute("SELECT * FROM director WHERE popit_id=?", (popit_id, ))
@sweemeng
sweemeng / popit_object.py
Last active March 27, 2018 06:25
A short cut to turn popit json into an python object
import requests
from collections import namedtuple
r = requests.get("https://api.popit.sinarproject.org/en/persons/0a342c3d0e61497a8fff144cdb98c513")
data = r.json()
Person = namedtuple('Persons', data["result"].keys())
person = Person(**data["result"])
print(person)
@sweemeng
sweemeng / Dummy.vue
Created March 10, 2018 04:08
vue-json-schema regex validation, didn't work
<template>
<el-card class="form">
<form-schema ref="formSchema" :schema="schema" v-model="model">
<el-button type="primary" @click="submit">Create</el-button>
</form-schema>
</el-card>
</template>
<script>
import FormSchema from 'vue-json-schema'
import schema from '../schema/dummy.json'
@sweemeng
sweemeng / PopitList.vue
Created January 18, 2018 03:31
vue file for Sinar Project popit API POC 0.001
<template>
<ul v-if="results && results.length">
<li v-for="result of results" :key="result.id">
<p>{{ result.name }}</p>
</li>
</ul>
</template>
<script>
import axios from 'axios'

Keybase proof

I hereby claim:

  • I am sweemeng on github.
  • I am sweemeng (https://keybase.io/sweemeng) on keybase.
  • I have a public key ASAQidbh1Q8JCLzmjPC7n8uKTmXbHsUftf_g-laNoPaBIwo

To claim this, I am signing this object:

@sweemeng
sweemeng / config.yaml
Created October 12, 2016 04:41
Google vision API example used with raspberry pi, pi camera with GPIO to trigger
accepted:
- mobile phone
- electronics
- paper