Skip to content

Instantly share code, notes, and snippets.

@ihoka
ihoka / homebrew.mxcl.memcached.plist
Created January 23, 2015 13:10
Memcached Launchd config with increased cache size
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.memcached</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<table class="border-1 border-grey border-top border-bottom border-left border-right">
<tr>
<td colspan="2" class="center bg-f2f2f2 border-1 border-grey border-bottom">Credit Calculations</td>
</tr>
<tr>
<td>Adjusted credit</td>
<td class="justify-right">$-250.00</td>
</tr>
<tr>
<td>Loss allocation</td>
@ihoka
ihoka / blinksale-html-tags-attributes.md
Last active August 29, 2015 14:01
Blinksale HTML tags and attributes
  • a: class, href
  • b: class
  • blockquote: class, cite
  • br: class
  • caption: class
  • cite: class
  • code: class
  • col: class
  • colgroup: class
  • dd: class
@ihoka
ihoka / blinksale-notes-styling.css
Created April 17, 2014 12:07
Blinksale CSS classes available in invoice notes
.bg-f2f2f2 {
background-color: #f2f2f2; }
.fg-red {
color: red; }
.bg-red {
background-color: red; }
.fg-white {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@ihoka
ihoka / 0-readme.md
Created October 30, 2012 09:01 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@ihoka
ihoka / Explanation.md
Created October 15, 2012 18:20 — forked from jrochkind/Explanation.md
Truncating html with nokogiri, with/without Rails

Rails has a handy truncate helper (which is actually mostly a method added to String ), but it warns you it's not safe to use on html source, it'll cut off end tags and such.

What if you want an HTML safe one? There are a variety of suggested solutions you can google, none of which were quite robust/powerful enough for me.

So I started with my favorite, by Andrea Singh, using nokogiri.

But:

  • I modified it to not monkey-patch Nokogiri, but be a static method instead (sadly making already confusing code yet more confusing, but I didn't want to monkey patch nokogiri)
<html>
<head>
<title>Webkit bug</title>
<style type="text/css">
#wrapper {
width: 200px;
}
table {
table-layout: fixed;
@ihoka
ihoka / gist:3083695
Created July 10, 2012 14:39
RVM with OpenSSL
# Install Ruby with RVM OpenSSL
rvm pkg install openssl
rvm reinstall 1.9.3-p125 --with-openssl-dir=$rvm_path/usr
# Download certs
cd $rvm_path/usr/ssl
curl -O http://curl.haxx.se/ca/cacert.pem
mv cacert.pem cert.pem
@ihoka
ihoka / hack.sh
Created March 31, 2012 12:43 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#