Skip to content

Instantly share code, notes, and snippets.

View elct9620's full-sized avatar
💦
Level up!!!

蒼時弦や elct9620

💦
Level up!!!
View GitHub Profile
@elct9620
elct9620 / gist:1534097
Created December 29, 2011 13:23
Flash AIR for iOS Tap Test
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TouchEvent;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; //設定觸控模式
Object(root).movie.stop(); //停止 movie 影片片段播放
Object(root).movie.addEventListener(TouchEvent.TOUCH_TAP, myPlay); //新增觸控事件偵測(點擊 Tap)
var playMode:Boolean = false; //播放模式,預設 stop ( FALSE 為 stop )
@elct9620
elct9620 / composer.json
Created January 21, 2013 04:20
Composer create a slim framework project, and integrate LazyRecord.
{
"name": "slim/slim-skeleton",
"description": "A Slim Framework skeleton application for rapid development",
"keywords": ["microframework","rest","router"],
"homepage": "http://github.com/codeguy/Slim-Skeleton",
"license": "MIT",
"authors": [
{
"name": "Josh Lockhart",
"email": "info@joshlockhart.com",
@elct9620
elct9620 / aotoki.zsh-theme
Last active December 17, 2015 13:39
My oh-my-zsh theme
# ---------------------------------------------------------------
# Aotoki Theme for oh-my-zsh theme by Aotoki (elct9620@frost.tw)
# Home Page : http://frost.tw/
# --------------------------------------------------------------
# LS Color
LSCOLORS=xxbxcxxxxxdxBxxxxxCxExBhCh
#Color Shortcuts
R=$fg[red]
@elct9620
elct9620 / shortcode.php
Created June 20, 2013 06:56
WordPress Plugin Example
<?php
namespace Aotoki;
class YoutubeShortcode {
static private $_instance;
private function __construct()
{
<?php
class Nyan_Template
{
public $mode = null;
public function __construct($mode)
{
$this->mode = $mode;
}
@elct9620
elct9620 / dsl.txt
Created June 27, 2016 07:43
Ruby DSL - Polish Text
let number1 equal 1 plus 1
let number2 equal 1 multiple 2
show number1 plus number2
@elct9620
elct9620 / Gemfile
Created September 27, 2016 08:22
RxRuby - Simple HTTP Server
# frozen_string_literal: true
# A sample Gemfile
source "https://rubygems.org"
gem "rx"
#include <iostream>
#include "mruby.h"
#include "mruby/data.h"
#include "mruby/compile.h"
#include "mruby/string.h"
#include "mruby/class.h"
class Application {
public:
require 'socket'
def open(id)
fn = "/sys/class/gpio/gpio#{id}/direction"
File.write('/sys/class/gpio/export', id) unless File.exist?(fn)
File.write(fn, "out")
end
def pin(id, value)
fn = "/sys/class/gpio/gpio#{id}/value"
@elct9620
elct9620 / simple-reactive.rb
Last active December 30, 2016 07:36
Reactive Programming implement in Ruby (Self implemented version)
=begin
Observable.create( -> (x) { x.on_next(1) }
.subscribe( -> (x) { p x })
=end
require 'set'
class Scheduler
def initialize
@thread = Thread.new { run }