Skip to content

Instantly share code, notes, and snippets.

View isuke's full-sized avatar
🎵
Listening to music, and coding

FUJIYAMA Isuke isuke

🎵
Listening to music, and coding
View GitHub Profile
@rsirres
rsirres / await_example.nim
Created March 24, 2017 21:38
Nimlang Nim await example
import os, asyncnet, asyncdispatch
proc callback1(): Future[int] =
var retFuture = newFuture[int]("callback1")
echo "Callback1: Waiting"
sleep(3000)
retFuture.complete(10)
return retFuture
@rafaels88
rafaels88 / factory_girl_helper.rb
Last active March 3, 2019 21:21
Factory Girl helper to work with Hanami Framework
# USAGE
# 1. Add 'factory_girl' in Gemfile as a dependency. But here, be careful. Factory Girl adds Active Support
# as its dependency, so it is up to you add it in :development and :test group or add it for all envs.
# For more details, read the comment from @cllns below.
# 2. Save this file in '/spec';
# 3. Load this file in 'spec_helper.rb' as the last require in the file, using:
# require_relative './factory_girl_helper'
@mutewinter
mutewinter / package.json
Created October 4, 2016 21:28
Use Jest with CoffeeScript
{
"jest": {
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"coffee"
],
"preprocessorIgnorePatterns": [ ],
@miyakogi
miyakogi / nim_syntax.md
Last active April 30, 2023 07:24
Syntax of Nim
@michaelglass
michaelglass / alerts_and_confirms.rb
Last active September 24, 2019 10:15
test alerts & confirms in poltergeist & capybara webkit
module AlertConfirmer
class << self
def reject_confirm_from &block
handle_js_modal 'confirm', false, &block
end
def accept_confirm_from &block
handle_js_modal 'confirm', true, &block
end
@suu-g
suu-g / libv8_check.rb
Last active December 29, 2015 01:39
Check if your environment can use the latest libv8 without compiling it
require 'rubygems'
require 'rubygems/dependency_installer'
require 'json'
require 'open-uri'
class GemVersions
def initialize(gem)
@gem = gem
@versions = JSON.parse(
@jakubkulhan
jakubkulhan / indent.pegjs
Created July 28, 2012 10:42
Python style indentation parser in PEG.js
// do not use result cache, nor line and column tracking
{ var indentStack = [], indent = ""; }
start
= INDENT? lines:( blank / line )*
{ return lines; }
line
= SAMEDENT line:(!EOL c:. { return c; })+ EOL?