Skip to content

Instantly share code, notes, and snippets.

View cynthia's full-sized avatar
💩
<- mainly producing this

Sangwhan "fish" Moon cynthia

💩
<- mainly producing this
View GitHub Profile
@cynthia
cynthia / Main.kt
Created April 20, 2016 01:35
Extremely simple Slack bot example in Kotlin
// Dependencies: com.ullink.slack:simpleslackapi:0.4.6
// License: MIT
package com.sangwhan.demobot
import com.ullink.slack.simpleslackapi.impl.SlackSessionFactory
fun main(args: Array<String>) {
val session = SlackSessionFactory.createWebSocketSlackSession("foobar");
session.connect();
@cynthia
cynthia / keybindings.json
Last active April 15, 2016 10:00
Visual Studio Code keybindings to match other applications for Back/Forward on Mac OS X
[
{ "key": "cmd+[", "command": "workbench.action.navigateBack" },
{ "key": "cmd+]", "command": "workbench.action.navigateForward" },
{ "key": "shift+tab", "command": "editor.action.outdentLines",
"when": "editorTextFocus && editorHasSelection" },
{ "key": "tab", "command": "editor.action.indentLines",
"when": "editorTextFocus && editorHasSelection" },
{ "key": "ctrl+r", "command": "workbench.action.debug.start",
"when": "!inDebugMode" }
]
[cynthia@jumalauta ~]$ python -m cProfile numbers.py
1600003 function calls in 0.950 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.142 0.142 0.950 0.950 numbers.py:1(<module>)
200000 0.576 0.000 0.805 0.000 numbers.py:1(StrNumberCommaInsert)
400000 0.044 0.000 0.044 0.000 {len}
400000 0.059 0.000 0.059 0.000 {method 'append' of 'list' objects}
import java.lang.reflect.Field;
class WhoSaidImmutable
{
public static void main(String argv[])
{
String s = new String("I AM INVINCIBLE! MWAHAHAHA!");
System.out.println(s);
System.out.println(s.hashCode());
--- autoconf-2.65/doc/autoconf.texi 2009-11-05 10:42:15.000000000 +0800
+++ autoconf-2.65/doc/autoconf.texi.new 2013-05-28 05:41:09.243770263 +0800
@@ -15,7 +15,7 @@
@c The ARG is an optional argument. To be used for macro arguments in
@c their documentation (@defmac).
@macro ovar{varname}
-@r{[}@var{\varname\}@r{]}@c
+@r{[}@var{\varname\}@r{]}
@end macro
--- Info1.plist 2015-01-29 14:24:06.000000000 +0900
+++ Info2.plist 2015-01-29 14:24:48.000000000 +0900
@@ -16,6 +16,8 @@
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
+ <key>NSHighResolutionCapable</key>
+ <true/>
<key>CFBundleDocumentTypes</key>
<array>
<!DOCTYPE html>
<!--[if lt IE 7]><html class="ie6" lang="ko"><![endif]-->
<!--[if IE 7]><html class="ie7" lang="ko"><![endif]-->
<!--[if IE 8]><html class="ie8" lang="ko"><![endif]-->
<!--[if gt IE 8]><!--><html lang="ko"><!--<![endif]-->
<head>
<title>Your Title</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
--- appicon.py 2015-01-23 02:21:33.000000000 +0900
+++ appicon2.py 2015-01-23 02:47:26.000000000 +0900
@@ -4,6 +4,7 @@
import os
import sys
from wand.image import Image
+from wand.exceptions import BlobError, CoderError, MissingDelegateError
DIMENSIONS = {
'OSX': [
switch (someshit)
{
case FIRST_CASE: { first_do_this(); then_do_that(); finally_do_that(); break; }
case SECOND_CASE: { first_do_this(); but_now_that(); finally_do_that(); break; }
case THIRD_CASE: { now_first_do_this(); then_do_that(); /* do nothing here */ break; }
default: { first_do_this(); /* do nothing here */ finally_do_that(); break; }
}
# Workaround for Python 3 Compatibility.
try:
import configparser
except ImportError:
# noinspection PyPep8Naming
import ConfigParser as configparser