Skip to content

Instantly share code, notes, and snippets.

@hackedunit
hackedunit / Bash aliases
Created February 3, 2009 07:29
Bash aliases
export PS1="\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[00m\] \`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '[\1] ')\"\`\[\033[00m\]$\[\033[00m\] "
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export SVN_EDITOR='/usr/bin/mate -w'
export HGEDITOR='/usr/bin/mate -w'
# System
alias ll='ls -alhG'
alias cvps='cd ~/Projects/Rails/vps-net'
alias cbil='cd ~/Projects/Rails/billings'
alias mysql='/usr/local/mysql/bin/mysql'
# RAILSLOVE.com template
#
# with help and ideas from:
# http://gist.github.com/33337 By Peter Cooper
# http://github.com/jeremymcanally/rails-templates/tree/master/suspenders.rb Suspenders by Thoughtbot Nathan Esquenazi
if yes?("symlink local rails copy to vendor?")
path = ask("what's the directory of your local rails copy?")
inside('vendor') { run "ln -s #{path} rails" }
require 'sinatra/base'
class ResqueWeb < Sinatra::Base
require 'resque/server'
use Rack::ShowExceptions
# Set the AUTH env variable to your basic auth password to protect Resque.
AUTH_PASSWORD = ENV['AUTH']
if AUTH_PASSWORD
Resque::Server.use Rack::Auth::Basic do |username, password|
<?xml version="1.0" encoding="UTF-8"?>
<homescreen>
<created-at type="datetime">2011-06-05T11:21:54Z</created-at>
<description>something</description>
<device-type type="integer">0</device-type>
<id type="integer">19</id>
<image-content-type>image/png</image-content-type>
<image-file-name>IMG_0023.PNG</image-file-name>
<image-file-size type="integer">135452</image-file-size>
<image-updated-at type="datetime">2011-06-05T11:21:54Z</image-updated-at>
@hackedunit
hackedunit / Import notes.scpt
Created October 30, 2011 17:55
Import a folder of text files into Apple Mail as notes
tell application "Finder"
activate
set the source_folder to choose folder
set note_files to (every file in source_folder) as alias list
end tell
repeat with i from 1 to number of items in note_files
try
open for access item i of note_files
set txt to read item i of note_files
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
class BooksController < UITableViewController
def viewDidLoad
super
loadBooks
end
def numberOfSectionsInTableView(tableView)
return 1
end
@hackedunit
hackedunit / install.markdown
Last active April 4, 2016 18:29
Cloud.net install guide

This is a quick step-by-step guide to install Cloud.net on a server using Docker.

Minimum requirements

  • A server running Ubuntu 14.04 LTS with at least 2GB of RAM.
  • Onapp control panel with required permissions
  • SMTP and few other third party logins

Installation

[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple
# Change to match your CPU core count
workers 8
# Min and Max threads per worker
threads 4, 8
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"
# Default to production