Skip to content

Instantly share code, notes, and snippets.

@kyroskoh
kyroskoh / aws-multipartUpload.js
Created June 27, 2017 08:31 — forked from sevastos/aws-multipartUpload.js
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@kyroskoh
kyroskoh / AWS_S3_File_Upload.js
Created June 27, 2017 08:15 — forked from homam/AWS_S3_File_Upload.js
How to upload files to AWS S3 with NodeJS SDK
var AWS = require('aws-sdk'),
fs = require('fs');
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
@kyroskoh
kyroskoh / Amazon S3 Client Side Upload
Created June 27, 2017 08:10 — forked from MichMich/Amazon S3 Client Side Upload
Example of an Amazon S3 upload.
<!DOCTYPE html>
<html>
<head>
<title>AWS S3 File Upload</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
</head>
<body>
<input type="file" id="file-chooser" />
@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>