Skip to content

Instantly share code, notes, and snippets.

# load a podspec via HTTP
# example from http://docs.cocoapods.org/podfile.html#pod
app.pods do
pod 'JSONKit', :podspec => 'https://raw.github.com/gist/1346394/1d26570f68ca27377a27430c65841a0880395d72/JSONKit.podspec'
end
# Throws this error:
=begin
[Bug] Unable to find the specification for `JSONKit (from `https://raw.github.com/gist/1346394/1d26570f68ca27377a27430c65841a0880395d72/JSONKit.podspec`)`.
@masuidrive
masuidrive / gist:5169096
Created March 15, 2013 11:11
nodeとmrubyのissuesとcommentsの単語分布
1, this, 17544
2, that, 15950
3, have, 9742
4, with, 9584
5, http, 8688
6, node, 6024
7, should, 5743
8, error, 4285
9, test, 4209
10, work, 4175
@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 = {})
@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

問題・目的

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

方法

  1. いじりたいスプレッドシートで [ツール] → [スクリプトエディタ…] を開く (Google ドライブの新規作成から、スクリプトを選んでもいい)
  2. スクリプトエディタに code.gs の内容をはっつける。

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

@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;
@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.
@andyferra
andyferra / 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 {
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
'