Skip to content

Instantly share code, notes, and snippets.

@kuoe0
kuoe0 / DC.md
Last active December 17, 2017 16:31

12/19

19:40 ~ 23:10 Train 175 / Penn Station (NYP) → Union Station (WAS)****

23:10 ~ Go to hotel


12/20

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@kuoe0
kuoe0 / AndroidPresentationDeviceProvider.js
Last active August 15, 2016 02:43
Add a new XPCOM implemented by JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
/* globals Components, dump */
"use strict";
dump("AndroidPresentationDeviceProvider.js loaded.");
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
@kuoe0
kuoe0 / .autoenv.zsh
Created May 10, 2016 08:57
Autoenv for Gecko
################################################################################
# Usage: ln -s </path/to/this/file> $GECKO/.autoenv.zsh
################################################################################
OS=$(uname)
autostash GECKO=$(git rev-parse --show-toplevel)
alias mach="$GECKO/mach"
# Load completion for mach
autoload bashcompinit
@kuoe0
kuoe0 / fft.py
Created October 12, 2014 12:20
Python FFT Example
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>semantic-slider</title>
<style>
.ui.slider.range input[type="range"] {
-webkit-appearance: none;
border-width: 1px;
#! /usr/bin/env python
#coding=utf-8
import pty
import os
import select
def mkpty():
#
@kuoe0
kuoe0 / divisible-by-3-fsm.y
Created December 14, 2013 12:35
check integer divisible by 3 using finite state machine
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-alt-sum.py
Created December 14, 2013 12:35
check integer divisible by 3 using alternative sum
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-hex.py
Created December 14, 2013 12:34
check integer divisible by 3 using hex
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""