Skip to content

Instantly share code, notes, and snippets.

View chakrit's full-sized avatar

Chakrit Wichian chakrit

View GitHub Profile
task debug() {
System.out.println "listing..."
android.libraryVariants.each { variant ->
System.out.println "VARIANT:"
System.out.println variant.name
variant.javaCompile.classpath.each { cp ->
System.out.println cp
}
}
System.out.println "Done."
var render = require('apiary-blueprint-render').render;
process.stdin.on('data', function(chunk) {
process.stdout.write(render(chunk.toString()));
});
Error: 140735136821632:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:766:
at SlabBuffer.use (tls.js:232:18)
at CleartextStream.read [as _read] (tls.js:450:29)
at CleartextStream.Readable.read (_stream_readable.js:320:10)
at EncryptedStream.write [as _write] (tls.js:366:25)
at doWrite (_stream_writable.js:219:10)
at writeOrBuffer (_stream_writable.js:209:5)
at EncryptedStream.Writable.write (_stream_writable.js:180:11)
at write (_stream_readable.js:583:24)
@chakrit
chakrit / not-ok.js
Last active December 21, 2015 08:39
var bunyan = require('bunyan')
, logger = null;
function thisIsNotOk() {
logger = bunyan.createLogger(
{ name: 'test'
, streams: [
{ type: 'rotating-file'
, path: 'test.log' }]
});
Usage: configure [options]
Options:
-h, --help show this help message and exit
--debug Also build debug build
--prefix=PREFIX Select the install prefix (defaults to /usr/local)
--without-npm Don't install the bundled npm package manager
--without-ssl Build without SSL
--without-snapshot Build without snapshotting V8 libraries. You might
want to set this for cross-compiling. [Default: False]
@chakrit
chakrit / SSL in English.md
Last active December 21, 2015 01:48
SSL in English.

SSL in English.

Server-side

Key-(re-)generation

  1. Generates an RSA public/private key pair.
  2. Uploads the public key to the CA.
  3. The CA issues a validity certificate.
  4. Appends any intermediate certificate to it as necessary.
  5. Installs the CA and public key on the server.
<resources>
<style name="CCCBaseTheme" parent="@android:style/Theme.Holo">
<item name="android:background">@color/nav_background</item>
<item name="android:textColor">@color/text</item>
<!-- ActionBar overrides -->
<item name="android:actionBarStyle">@style/CCCWidgetActionBar</item>
<item name="android:actionBarItemBackground">@color/nav_background</item>
@chakrit
chakrit / test.coffee
Created July 4, 2013 07:34
rx vs indexOf test
assert = require 'assert'
words = 'apple|orange|pear|banana|kiwi'.split '|'
strings =
noMatch : "The quick brown fox jumps over the lazy dog."
startMatch : "An apple is nice"
endMatch : "This is a longer sentence with the match for our fruit at the end: kiwi apple orange pear banana"
;; Taken from Stevie's Blog Rant http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html
(defun js2-parse-variables (in-for decl-type)
"Parse a 'var', 'const' or 'let' statement or for-loop initializer.
IN-FOR is true if we are currently in the midst of the init clause of a for.
DECL-TYPE is a token value: either VAR, CONST, or LET depending on context.
Returns the parsed statement node."
(let ((result (make-js2-var-decl-node))
destructuring-init
destructuring
@chakrit
chakrit / gen.sh
Last active December 19, 2015 01:19
#!/bin/bash
seq 100 999 | while read num; do
URL="http://qrfree.kaywa.com/?l=1&s=8&d=$num"
NAME="qr-$num.png"
sleep 1
echo "Downloading $NAME..."
curl -s "$URL" > $NAME
open $NAME