Skip to content

Instantly share code, notes, and snippets.

@kyroskoh
kyroskoh / EduGIS_viz_demo.html
Last active August 2, 2016 09:29
EduGIS_viz_demo
<!DOCTYPE html>
<html>
<head>
<title>createLayer + two sublayers</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style>
html, body, #map {
height: 100%;
padding: 0;
@kyroskoh
kyroskoh / GAME_MASTER_v0_1.protobuf
Created August 14, 2016 14:28 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@kyroskoh
kyroskoh / S3 buckets copy.md
Created September 26, 2016 10:13 — forked from ushu/S3 buckets copy.md
Copy between S3 buckets w/ different accounts

This is a mix between two sources:

basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts

Basically the idea there is:

  • we allowe the destination account to read the source bucket (in the console for the source account)
  • we log as the destination and start the copy
@kyroskoh
kyroskoh / Gemfile
Created September 27, 2016 02:18 — forked from carlosgaldino/Gemfile
Copy objects from multiple S3 buckets to another.
source 'https://rubygems.org'
gem 'aws-sdk', '~> 1.30.1'
@kyroskoh
kyroskoh / index.html
Created November 7, 2016 05:39 — forked from AlcaDesign/index.html
An almost complete tmi.js example (browser)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Chat</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.js"></script> <!--For developement-->
<!--<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.min.js"></script>--> <!--For "production"-->
</head>
@kyroskoh
kyroskoh / load_data.erl
Created December 7, 2016 08:51
Erlang script to load data in Riak KV
#!/usr/bin/env escript
%% -*- erlang -*-
main([Filename]) ->
{ok, Data} = file:read_file(Filename),
Lines = tl(re:split(Data, "\r?\n", [{return, binary},trim])),
lists:foreach(fun(L) -> LS = re:split(L, ","), format_and_insert(LS) end, Lines).
format_and_insert(Line) ->
JSON = io_lib:format("{\"Date\":\"~s\",\"Open\":~s,\"High\":~s,\"Low\":~s,\"Close\":~s,\"Volume\":~s,\"Adj. Close\":~s}", Line),
Command = io_lib:format("curl -XPUT http://127.0.0.1:8091/riak/goog/~s -d '~s' -H 'content-type: application/json'", [hd(Line),JSON]),
@kyroskoh
kyroskoh / index.html
Created December 28, 2016 19:39 — forked from anonymous/index.html
Twitch Social Popup
<link href='https://fonts.googleapis.com/css?family=Montserrat:700' rel='stylesheet' type='text/css'>
<div id="popup-container">
<div class="popup twitter-pop" data-box="enableTwitter">
<div class="left">
<span class="twitter"></span>
</div>
<div class="right twitterUsername">
<span data-name="twitterUsername"></span>
</div>
</div>
@kyroskoh
kyroskoh / README.md
Created February 2, 2017 03:26 — forked from debashisbarman/README.md
A Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

#Creating a Twitter bot with Node.js Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

##Tools we need Here are the tools we’ll be using to create the bot — 

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application

@kyroskoh
kyroskoh / nginx request id_README.md
Created March 20, 2017 04:02 — forked from oroce/README.md
nginx request id
@kyroskoh
kyroskoh / nginx.conf
Created March 20, 2017 04:04 — forked from erikcw/nginx.conf
Simple nginx lua script to add UUID to each request for end to end request tracking.
# Dependencies
# nginx_lua
# lua uuid module (luarocks install uuid)
http {
# this will be the request id
map $host $request_uuid {
default '';
}