Skip to content

Instantly share code, notes, and snippets.

View iissnan's full-sized avatar
💭
I may be slow to respond.

Vi iissnan

💭
I may be slow to respond.
View GitHub Profile
@iissnan
iissnan / index.js
Last active September 23, 2016 11:34
SW Sass Processor
var fs = require('fs'),
os = require('os'),
path = require('path'),
Hapi = require('hapi'),
Promise = require('promise'),
lib = require('./lib.js'),
sassProcessor = require('./sass_processor.js'),
pseudoProcessor = require('./pseudo_processor') ;
@iissnan
iissnan / hexo-helper-categories-state.js
Created March 3, 2017 09:07
Categories State Helper for Hexo
/* global hexo */
/**
* options {Object}
* options.url {Function} hexo url_for
* options.label {String} label
*/
hexo.extend.helper.register('categories_state', function(options){
var pages = hexo.locals.get('pages');
var categories = hexo.locals.get('categories');
@iissnan
iissnan / posts-controller.rb
Created April 7, 2017 05:40
#Rails - Insert attributes into Request Params
class PostsController < ApplicationController
def create
Post.create!(post_params)
end
private
def post_params
params.require(post).permit(:some_attrs).merge(user_id: current_user.id)
@iissnan
iissnan / tail.ps1
Last active December 13, 2020 11:39
Unix tail equivalent command in Windows Powershell
Get-Content ./log.log -Wait -Tail 10
@iissnan
iissnan / jasmine-async-await.md
Last active April 20, 2021 01:39
Jasmine with Async/Await

Background

Jasmine has Asynchronous Support which uses "function + done" formular. This spec will not start until the done function is called in the call to beforeEach. And this spec will not complete until its done is called.

beforeEach(function(done) {
  setTimeout(function() {
    value = 0;
    done();
  }, 1);