Skip to content

Instantly share code, notes, and snippets.

@xl1
xl1 / background.coffee
Last active October 4, 2015 00:58
open phone2chrome last synced page (Chrome extention)
PAGES_URL = "http://dl.dropboxusercontent.com/s/***/pages" # Dropbox/phone2chrome/pages
openedURLs = []
getPages = (callback) ->
xhr = new XMLHttpRequest()
xhr.open 'GET', PAGES_URL, true
xhr.onload = ->
text = xhr.responseText
@xl1
xl1 / gist:2640706
Created May 9, 2012 00:28
@rousaibot on Google Spreadsheet
/*
copied from https://sites.google.com/site/usakoyama/gastotwitterbot
*/
function tweetInitialize() {
// Setup OAuthServiceConfig
var oAuthConfig = UrlFetchApp.addOAuthService("twitter");
oAuthConfig.setAccessTokenUrl("http://api.twitter.com/oauth/access_token");
oAuthConfig.setRequestTokenUrl("http://api.twitter.com/oauth/request_token");
oAuthConfig.setAuthorizationUrl("http://api.twitter.com/oauth/authorize");
oAuthConfig.setConsumerKey(ScriptProperties.getProperty("twitterConsumerKey"));
@xl1
xl1 / gist:3111497
Created July 14, 2012 14:04
SCSS で単位を落とす
/*
@function int($x) {
$list: ();
@for $i from floor($x - $x) to floor($x) {
$list: append($list, 0);
}
@return length($list);
}
*/
// もっとよいやり方がある
// support()
$support-webkit: true;
$support-moz: true;
$support-ms: true;
$support-o: true;
@mixin support($list) {
$support-webkit: index($list, webkit);
$support-moz: index($list, mozilla);
$support-ms: index($list, ms);
@xl1
xl1 / index.coffee
Last active October 7, 2015 20:38
cui-about.me に日記を書く
cuiaboutme = 'http://cui-about.me/'
$ = (id) -> document.getElementById id
getData = ->
inputs = document.querySelectorAll('input, textarea')
res = []
for input in inputs
id = input.id
if id isnt 'name' and id isnt 'submit'
@xl1
xl1 / gist:3265679
Created August 5, 2012 16:20
ショートカットキー設定するやつ
class window.KeyHandler
@KEYDOWN_STRING =
8: 'BS'
9: 'Tab'
13: 'Enter'
27: 'Esc'
28: 'Henkan'
29: 'Muhenkan'
32: 'Space'
33: 'PageUp'
@xl1
xl1 / README
Created September 14, 2012 01:42
2012-09-14 1st
http://jsdo.it/xl1/sO4m
@xl1
xl1 / jsdoit.css
Created September 24, 2012 15:36
2012-09-25 1st
#julia {
width: 450px;
height: 450px;
-webkit-filter: custom(
url(normal.vs) url(julia.fs),
constant 0.75 -0.314
);
-webkit-transition: -webkit-filter 6s;
}
#julia:hover {
@xl1
xl1 / genie.vs
Last active October 11, 2015 01:58
precision mediump float;
#define PI 3.14159265359
attribute vec4 a_position;
uniform mat4 u_projectionMatrix;
uniform vec2 u_textureSize;
uniform vec2 target;
uniform float timing;
@xl1
xl1 / golf.fs
Created October 21, 2012 15:22
ゴルフのやつ
// http://jsdo.it/xl1/aTTK
#define REFLECT_MAX 10
#define NODE_LEN 10
precision mediump float;
struct Segment {
vec2 start;
vec2 dir;