Skip to content

Instantly share code, notes, and snippets.

@kyroskoh
kyroskoh / WebhookTutorial.md
Created April 15, 2017 18:07 — forked from jagrosh/WebhookTutorial.md
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@kyroskoh
kyroskoh / WebhookTutorial.md
Created April 15, 2017 18:07 — forked from jagrosh/WebhookTutorial.md
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@kyroskoh
kyroskoh / .goaccess
Created April 12, 2017 07:15 — forked from PhantomRay/.goaccess
goaccess log/time/date format for AWS S3
# AWS S3 Log Format
# config file
date-format %d/%b/%Y
time-format %T
log-format %^ %^ [%d:%t %^] %h %^ %^ %^ %^ "%^ %r %^" %s %^ %b %^ %^ %^ "%^" "%u" %^
# example log
#
1d82a3126606ef56450b5ea405d549ce4e5a5c29ccd240012c6032c9d7dc454f random [09/Aug/2015:06:20:46 +0000] 1.129.96.209 - 494F7E82C4F16813 REST.HEAD.OBJECT files/24/2015-08/e86c1ab2-563b-40f8-aa61-3eecefe30867_f.png "HEAD /app/files/24/2015-08/e86c1ab2-563b-40f8-aa61-3eecefe30867_f.png HTTP/1.1" 200 - - 8610 19 - "-" "someapp/3.0.0 (Windows_NT; x64 6.1.7601; Intel R Core TM i3-4160 CPU @ 3.60GHz) nodejs/v0.10.29 device/12345" -
@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 '';
}
@kyroskoh
kyroskoh / nginx request id_README.md
Created March 20, 2017 04:02 — forked from oroce/README.md
nginx request id
@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 / 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 / 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 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 / 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'