Skip to content

Instantly share code, notes, and snippets.

View mmmpa's full-sized avatar
👷‍♂️
working

mmmpa mmmpa

👷‍♂️
working
View GitHub Profile
module Arel
module Nodes
const_set 'Separator', Class.new(Binary)
end
module Visitors
class ToSql < ::Arel::Visitors::Reduce
def visit_Arel_Nodes_Separator o, collector
collector = visit o.left, collector
collector << " SEPARATOR "
require 'active_record'
require 'active_support/hash_with_indifferent_access'
require 'rspec'
require 'mysql2'
DATABASE_NAME = :sql_playground_database.to_s
DATABASE_CONFIGURATION_BASE = {
adapter: :mysql2,
host: :localhost,
username: ENV['MYSQL_USER_NAME'],
<?php
$path = $_SERVER["SCRIPT_FILENAME"];
if(preg_match("/\.html$/", $path)){
chdir(dirname($path));
return require($path);
}
return false;
# chromedriver configuration
# chrome の起動オプションが使える http://peter.sh/experiments/chromium-command-line-switches/
default_args = %w(
--window-position=2560,0
)
# ブラウザの外枠 (スクリーンショット撮って計測しよう)
chrome_frame_offset = {
w: 10,
require 'rails_erd/domain/relationship'
module RailsERD
class Domain
class Relationship
class << self
private
def association_identity(association)
Set[association_owner(association), association_target(association)]
export const mix = (superclass) => new MixinBuilder(superclass);
class MixinBuilder {
constructor(private superclass: any) {
}
mix(...mixins: any[]) {
return mixins.reduce((c, mixin) => mixin(c), this.superclass);
}
interface Stack {
up:()=>void,
down:()=>void
}
export default class HistoryStack {
// 固定長配列と終端を表すundefinedで循環配列として利用する
private history:Stack[][] = [];
private position:number = 0;
const assert = require('power-assert');
import HistoryStack from './src/models/history-stack';
describe('HistoryStack', ()=> {
describe('', ()=> {
it('基本', ()=> {
let stack = new HistoryStack();
let target = 0;
let action = (n)=>{
interface Stack{
up:()=>void,
down:()=>void
}
export default class HistoryStack {
private history:Stack[] = [];
private position:number = 0;
constructor(public length = 10){
@mmmpa
mmmpa / fa.hx
Created November 20, 2015 06:23
import flash.text.Font;
@:font("../lib/font-awesome/fonts/fontawesome-webfont.ttf") class Fa extends Font {
public static var name:String = (function(){
Font.registerFont(Fa);
return new Fa().fontName;
})();
public static var char:Dynamic = {
adjust: "\uf042",
adn: "\uf170",