Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@ryanflorence
ryanflorence / static_server.js
Last active July 21, 2024 12:43
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@mattetti
mattetti / multipart_upload.go
Last active July 18, 2024 17:31
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@nickbauman
nickbauman / ios_imperatives_for_approval.md
Last active November 1, 2019 12:10
Condensed iOS Human Interface Guidelines, formulated as imperatives.

Condensed iOS Human Interface Guidelines

Imperatives for AppStore approval

For iPhone app developers. Emphasis on getting the fastest app store approval. Everything stated as suggestion made into an imperative. When "violating" these imperatives, you can check for yourself what the caveats are. Generally speaking, deviating will more likely cause your app to be hung up in approval.

You can read this entire document in about 20 minutes. This is faster than reading and understanding the entire Human Interface Guidelines.

Overview

@ngpestelos
ngpestelos / remove-docker-containers.md
Last active May 31, 2024 15:10
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@stupidbodo
stupidbodo / csv.go
Last active February 12, 2024 07:05
Golang - Read CSV/JSON from URL
package main
import (
"encoding/csv"
"fmt"
"net/http"
)
func readCSVFromUrl(url string) ([][]string, error) {
resp, err := http.Get(url)
@skade
skade / links.md
Created November 26, 2014 11:32
Link list elasticsearch UG 2014/11
@takluyver
takluyver / gist:26fb3b7e365dce527886
Created April 19, 2015 23:32
Pycon videos by views
Results of running this script: https://gist.github.com/jabbalaci/398429347c96e98aba88
Views Ups Downs Title (Speakers)
9,810 166 3 Keynote - Jacob Kaplan-Moss - Pycon 2015 (Jacob Kaplan-Moss)
7,044 64 0 Type Hints - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,742 121 0 David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015 (David Beazley)
4,684 66 3 Keynote - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,272 78 1 Dan Callahan - My Python's a little Rust-y - PyCon 2015 (Dan Callahan)
2,694 34 0 How to build a brain with Python (Trevor Bekolay)
2,391 29 0 Andrew T. Baker - Demystifying Docker - PyCon 2015 (Andrew T. Baker)