Skip to content

Instantly share code, notes, and snippets.

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@rummelonp
rummelonp / Gemfile
Created February 1, 2012 09:15
Ruby だけで Twitter Bootstrap コンパイルするやつ
source 'http://rubygems.org'
gem 'less'
gem 'uglifier'
gem 'watchr'
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
yum install -y wget
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://rbel.co/rbel5
rpm -Uvh rbel5
yum install -y rubygem-chef
'
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@stanaka
stanaka / generate_pdf.pl
Created October 15, 2012 15:05
Generate pdf for analyzing kindle paperwhite resolution
#!/usr/bin/env perl
use strict;
use warnings;
use GD;
sub draw_page {
my ($width, $height) = @_;
return unless $width && $height;

Tracking Your Business

You've built (or are maintaining) a product which has many services over different machines at the backend, all orchestrating together to implement one or more business processes. How are you tracking this system?

In general: how can we provide visibility for linear-pipeline distributed systems where a series of processing stages are arranged in succession to perform a specific business function over a data stream (i.e. transaction), and across several machines?

A simple, somewhat crude, example for cross-systems transaction would be an order preparation system in real life, let's say in an electronics factory. During such a workflow, an order entering the processing pipeline goes through each stage defined by the manufacturing floor manager - "planning, provisioning, packing, shipping".

Taking this a bit closer to the Web, we can easily see instances of such transactions, even if we are not always aware we've implemented them that way. A background job is a pipeline, or a transa

問題・目的

  • 特定のスプレッドシートだけを外から更新したい
  • OAuth は大変めんどうかつ、特定のスプレッドシートのみ権限を与えることができない
  • Google Spread Sheet の XML API が全力で面倒

方法

  1. いじりたいスプレッドシートで [ツール] → [スクリプトエディタ…] を開く (Google ドライブの新規作成から、スクリプトを選んでもいい)
  2. スクリプトエディタに code.gs の内容をはっつける。
@kachick
kachick / ltsv.rb
Last active December 12, 2015 06:19
シンプルなLTSVフォーマットへのパーサ `row=Hash` で取り扱う http://stanaka.hatenablog.com/entry/2013/02/05/214833
# Copyight (c) 2013 Kenichi Kamiya
# No Strict parser for the LTSV(Labeled Tab Separated Values) format
# What is LTSV?
# @see http://stanaka.hatenablog.com/entry/2013/02/05/214833
module LTSV
ROW_SEPARATOR = "\n".freeze
COLUMN_DELIMITER = "\t".freeze
@nobu
nobu / ltsv.rb
Last active December 12, 2015 07:28
LTSV viewer in Ruby
# -*- coding: us-ascii -*-
require 'csv'
require 'yaml'
class LTSV < CSV
attr_accessor :ordered
alias ordered? ordered
def self.def_options(opt, options = {})