Skip to content

Instantly share code, notes, and snippets.

@syon
syon / materialcolors.rb
Created May 15, 2015 10:35
Generate Material Colors PNG with ImageMagick
file = File.open('materialcolors.txt')
file.each_line do |hex|
hex.gsub! "\n", ""
cmd = "convert -size 15x15 xc:##{hex} result/#{hex}.png"
system(cmd)
end
@syon
syon / screenshot.js
Created April 1, 2015 03:12
CasperJS sample
var props = {
// Chrome
pc:{
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36",
//viewport: { width: 2560, height: 1440 }
viewport: { width: 640, height: 480 }
},
// iPhone 5, iOS 8.0.2
mobile: {
ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A405 Safari/600.1.4",
var CommentBox = React.createClass({
loadCommentsFromServer: function() {
$.ajax({
url: this.props.url,
dataType: 'json',
success: function(data) {
this.setState({data: data});
}.bind(this),
error: function(xhr, status, err) {
console.error(this.props.url, status, err.toString());
@syon
syon / Gemfile
Last active August 29, 2015 14:06
tracks フォルダに格納した mp3 ファイルの情報を読み取って JSON ファイルに変換し tracks.json に出力します。
source "https://rubygems.org"
gem "ruby-audioinfo"
@syon
syon / Gemfile
Last active March 14, 2024 07:52
SVG-to-PNG Converter using Ruby-GNOME2/RSVG on Sinatra
source "https://rubygems.org"
gem "sinatra"
gem "haml"
gem "rsvg2"
Option Explicit
Public Sub Main()
Dim dataFileDirPath As String
Dim fileNameList As String
Dim tgtFileList As Collection
dataFileDirPath = ThisWorkbook.path & "\" & "datafiles"
Set tgtFileList = FNC_getDataFileList(dataFileDirPath, "*.xls")
package {
import starling.core.Starling;
import starling.display.Sprite;
import starling.display.Quad;
import starling.events.Event;
import starling.animation.Tween;
import starling.animation.Transitions;
public class Game extends Sprite
package {
import flash.display.BitmapData;
import flash.utils.Timer;
import flash.events.TimerEvent;
import starling.display.Sprite;
import starling.display.Image;
import starling.textures.Texture;
import starling.events.Event;
import nape.phys.Body;
package {
import starling.display.Sprite;
import starling.display.Quad;
import starling.events.Event;
public class Game extends Sprite
{
private var square:Quad;