Skip to content

Instantly share code, notes, and snippets.

View shimar's full-sized avatar

Ryohei Shima shimar

View GitHub Profile
@shimar
shimar / index.html
Created November 16, 2017 04:31
html layout with fixed navbar, sidebar and main content.
<!doctype html>
<html>
<head>
<style type="text/css">
html, body {
padding: 0;
margin: 0;
width: 100%;
}
body {
@shimar
shimar / index.js
Created May 18, 2017 02:56
Currency Filter
export default {
/**
* 12345 => $12,345.00
*
* @param {String} sign
* @param {Number} decimals Decimal places
*/
currency (value, currency, decimals) {
value = parseFloat(value)
@shimar
shimar / Vagrantfile
Created February 28, 2017 04:28
mongodb on vagrant.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
#!/usr/bin/env ruby
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'test_queue'
require 'test_queue/runner/rspec'
class RSpecQueueRunner < TestQueue::Runner::RSpec
def after_fork(num)
@shimar
shimar / get-os-caption-and-archi-on-powershell
Created June 2, 2015 02:22
Getting OS caption and Architecture on PowerShell.
# get OS caption
wmic os get caption
# get OS Architecture
wmic os get osarchitecture
@shimar
shimar / layout.jade
Created June 3, 2014 13:11
an example of jade file using connect-assets.
doctype html
html
head
title= title
!= css('application')
body
div.container-fluid
block content
!= js('application')
@shimar
shimar / application.js
Created June 3, 2014 13:10
an example of application.js using connect-assets.
// application.js.
//= require "jquery/dist/jquery"
//= require "json2/json2"
//= require "underscore/underscore"
//= require "backbone/backbone"
//= require_tree .
@shimar
shimar / app.js
Last active August 29, 2015 14:01
using connect-assets on node.js + express.js
var connectAssets = require('connect-assets');
app.use(connectAssets({
paths: [path.join(__dirname, 'assets/js'),
path.join(__dirname, 'assets/css'),
path.join(__dirname, 'components')],
buildDir: 'public/assets'
}));
@shimar
shimar / app.js
Created March 25, 2014 14:34 — forked from utaal/app.js
var http = require('http');
var connect = require('connect');
var socketio = require('socket.io');
var fs = require('fs');
var os = require('os');
var exec = require('child_process').exec;
var util = require('util');
var $ = require('underscore');
var load_data_in_mem_count = 3000;
doctype html
html
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(name='viewport', content='width=device-width,initial-scale=1.0')
title= title
link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css')
block css
body