Skip to content

Instantly share code, notes, and snippets.

View anggiaj's full-sized avatar

anggiaj anggiaj

  • Jakarta, Indonesia
View GitHub Profile
module PostRepresenter
include Representer
using Representer
def basic(post)
select(post, :id, :name)
end
def details(post)
basic(post) & comments(post)
@anggiaj
anggiaj / app.js
Created June 14, 2014 17:29 — forked from dskanth/app.js
var app = require('express').createServer()
var io = require('socket.io').listen(app);
var fs = require('fs');
app.listen(8008);
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
=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')
@anggiaj
anggiaj / digital-ocean.php
Created December 24, 2013 13:59
Guzzle definitions
<?php
return [
'name' => 'DigitalOcean',
'baseUrl' => 'https://api.digitalocean.com/',
'description' => '',
'operations' => [
// droplets
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.1.8 (2013-12-13)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
exit('Only to be used as an helper for your IDE');
# Build script for Jenkins. This builds the checked out code and will deploy it if the commit came from
# an environment specified in DEPLOYABLE_ENVIRONMENTS after a successful build.
require 'open-uri'
HIPCHAT_AUTH_TOKEN = "FILL ME IN"
HIPCHAT_ROOM = "FILL ME IN"
PROJECT_NAME = "FILL ME IN"
STAGING_URL = "https://staging.example.com"
PRODUCTION_URL = "https://www.example.com"
@anggiaj
anggiaj / build.xml
Created September 24, 2013 14:35
from sebastian bergman ppw
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by PHP Project Wizard (PPW) 1.0.4 on Tue Sep 24 20:57:44 WIT 2013 -->
<project name="testppw" default="build" basedir=".">
<property name="source" value="src"/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>