Skip to content

Instantly share code, notes, and snippets.

View kokizzu's full-sized avatar

Kiswono Prayogo kokizzu

View GitHub Profile
<code_scheme name="KyzCodeStyle">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="3" />
<option name="CONTINUATION_INDENT_SIZE" value="3" />
<option name="TAB_SIZE" value="3" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="true" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@kokizzu
kokizzu / .lua
Created August 5, 2016 02:28 — forked from pateltej/.lua
Lua in 15 minutes
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
@kokizzu
kokizzu / chat.go
Created November 10, 2016 02:32
simple golang chat server
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
#!/usr/bin/env ruby
require 'json'
require 'ap'
username = 'kokizzu'
ap "Fetch API users/#{username}/repos"
repos = `curl -s https://api.github.com/users/#{username}/repos?per_page=200`
@kokizzu
kokizzu / web-servers.md
Created December 22, 2016 11:48 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kokizzu
kokizzu / frp.md
Created February 20, 2017 08:01 — forked from ohanhi/frp.md
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@kokizzu
kokizzu / React Native: Animated - Code
Created March 31, 2017 08:37 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
' Copyright (c) 2007, Tony Ivanov
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
// old version: https://marcofranssen.nl/go-webserver-with-gracefull-shutdown/
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"