Skip to content

Instantly share code, notes, and snippets.

View kuyseng's full-sized avatar

Kuyseng CHHOEUN kuyseng

  • Yoolk Inc.
  • Phnom Penh, Cambodia
View GitHub Profile
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
dog.legs.walk! if dog.normal?
dog.hover_craft.hover! if dog.robot?
class SubscriptionPlan
attributes expiry_date: next_month, monthly_charge: 300, charge_per_rental: 0
end
class PrepaidPlan
attributes expiry_date: never, monthly_charge: 0, charge_per_rental: 100
end
def plan_type
case plan_type

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@kuyseng
kuyseng / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@kuyseng
kuyseng / SassMeister-input.scss
Created March 15, 2015 02:31
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$color-red: (
'50': #ffebee,
'100': #ffcdd2,
'200': #ef9a9a,
'300': #e57373,
@kuyseng
kuyseng / smartColorController.js
Created November 30, 2016 03:21
using promise in angular
// this controller depends on StyleSwitcherController in instant_website
;(function () {
'use strict';
angular
.module('iwApp')
.controller('SmartSite.Customize.SmartColorController', SmartColorController);
SmartColorController.$inject = ['$controller', '$scope', '$state', '$timeout', '$q', 'events', 'ApiService', 'logoFactory', 'SmartColorService'];
@kuyseng
kuyseng / 0_reuse_code.js
Created January 9, 2017 03:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kuyseng
kuyseng / delegate_methods.js
Created February 1, 2017 05:06
delegate method to other object. it's like method programming #define_method in Ruby
// delegate methods to wow-book
angular.forEach([ 'insertPage', 'insertPages', 'insertDoublePage', 'removePages' ],
function(name) {
ctrl[name] = function() { return ctrl.book[name].apply(ctrl.book, arguments) };
})