Skip to content

Instantly share code, notes, and snippets.

View rakhmad's full-sized avatar

Rakhmad Azhari rakhmad

View GitHub Profile
@rakhmad
rakhmad / Gemfile
Created September 15, 2012 02:07
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@rakhmad
rakhmad / gist:4043128
Created November 9, 2012 01:24
Jenkins, Xcode, Github, Testflight on a Mac Mini
  • Buy a mac mini
  • Install 10.8
  • Create a user account for Jenkins
  • Install xcode
  • Turn on screen sharing
  • Turn off energy save sleeping
  • Login as your jenkins user
  • Use ssh-keygen to create a key for github
  • Create a github account for your build machine
  • Add the key to your build machine github account
@rakhmad
rakhmad / gist:4161885
Created November 28, 2012 15:14 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@rakhmad
rakhmad / New reminder from Launchbar
Created November 28, 2012 15:46 — forked from mlgill/New reminder from Launchbar
A script for quickly adding reminders to the Reminders app in Mountain Lion from Launchbar and Alfred. Save this as a .scpt and drop it in ~/Library/Application\ Support/LaunchBar/Actions
--Script for setting Reminders for LaunchBar and Alfred
--For Alfred, Applescript must NOT be set to run in Background otherwise date parsing does not work
--For LaunchBar, place the script in ~/Library/Scripts/LaunchBar
--by Michelle L. Gill, 10/07/2012
--inspired by https://gist.github.com/3187630
--Notes on valid reminders
--Order of the text must be "title #note $list @date time" but note and list are optional. Date and time are also optional but both must be included if one is included
--Times can be in 12- or 24-hour format, and 24-hour format is assumed if am/pm are absent
--Times can include minutes and seconds (colon separated like hours:minutes:seconds) but minutes and seconds aren't required
@rakhmad
rakhmad / emoji_sad.txt
Created November 29, 2012 07:04 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@rakhmad
rakhmad / WebServer.py
Created December 11, 2012 15:30
Simple python bonjour advertised web server
#!/usr/bin/python
import BaseHTTPServer
import SimpleHTTPServer
import os
import subprocess
import shlex
import sys
import multiprocessing
@rakhmad
rakhmad / gist:4555677
Created January 17, 2013 12:39
Error log tomcat saat upload CSV
/usr/local/Cellar/tomcat/7.0.34/libexec/bin/catalina.sh run
Console output is saving to: /Users/rakhmad/output.log
[2013-01-17 06:48:08,252] Artifact MoslemCMS:war: Server is not connected. Press 'Deploy' to start deployment.
[2013-01-17 06:48:08,253] Artifact MoslemServer:war: Server is not connected. Press 'Deploy' to start deployment.
Jan 17, 2013 6:48:09 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/rakhmad/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Jan 17, 2013 6:48:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 17, 2013 6:48:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
/usr/local/Cellar/tomcat/7.0.34/libexec/bin/catalina.sh run
Console output is saving to: /Users/rakhmad/output.log
[2013-01-17 06:48:08,252] Artifact MoslemCMS:war: Server is not connected. Press 'Deploy' to start deployment.
[2013-01-17 06:48:08,253] Artifact MoslemServer:war: Server is not connected. Press 'Deploy' to start deployment.
Jan 17, 2013 6:48:09 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/rakhmad/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Jan 17, 2013 6:48:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 17, 2013 6:48:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
import org.apache.commons.codec.binary.Base64;
private String encodeFileToBase64Binary(String fileName)
throws IOException {
File file = new File(fileName);
byte[] bytes = loadFile(file);
byte[] encoded = Base64.encodeBase64(bytes);
String encodedString = new String(encoded);

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg