Skip to content

Instantly share code, notes, and snippets.

@paulmars
paulmars / head.html
Created September 10, 2013 18:12 — forked from juliangruber/head.html
requirebin sketch
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>
@paulmars
paulmars / gist:6528004
Created September 11, 2013 18:45
ssh back to my mac
# cribed from this post
# http://onethingwell.org/post/27835796928/remote-ssh-bact-to-my-mac
dns-sd -E # gets your member id for icloud
# SSH command
ssh -2 -6 [USERNAME]@[COMPUTER NAME].[account number].members.btmm.icloud.com
# ~/.ssh/config
Host mac-remote
@paulmars
paulmars / theme.html
Created April 11, 2014 19:34
Tumblr theme
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!--
___ ___
/ /\ / /\ ___
/ /::\ / /::\ /__/|
/ /:/\:\ ___ ___ / /:/\:\ | |:|
/ /:/~/:/ /__/\ / /\ / /:/~/::\ | |:|
@paulmars
paulmars / powdev.rb
Created October 29, 2014 18:22
Load pow env variables in dev
# Load pow environment variables into development and test environments
if File.exist?(".powenv")
IO.foreach('.powenv') do |line|
next if !line.include?('export') || line.blank?
key, value = line.gsub('export','').split('=',2)
ENV[key.strip] = value.delete('"\'').strip
end
end if Rails.env.development? || Rails.env.test?
source 'https://rubygems.org'
ruby '2.1.4'
gem 'rails', '4.2.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
@paulmars
paulmars / gist:77d2a757ab4f1bc99028
Created June 20, 2015 02:25
lock a script to run once
unless open(__FILE__).flock(File::LOCK_EX | File::LOCK_NB)
puts "script already running..."
exit
end
<h1>
test
</h1>
class Val
def self.check!(klass)
klass.find_each do |s|
begin
if !s.valid?
message = s.errors.full_messages.to_sentence
throw "#{klass.to_s} #{s.id} #{message}"
end
rescue => e
@paulmars
paulmars / gist:6619f5fb677ebf39196e
Created October 3, 2015 19:02
Backup time machine every 24 hours
sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 86400
@paulmars
paulmars / gist:ea82a17db565c6f5c526
Created October 4, 2015 19:07
rename your computer from CLI
# http://osxdaily.com/2012/10/24/set-the-hostname-computer-name-and-bonjour-name-separately-in-os-x/
sudo scutil --set ComputerName "NAME"
sudo scutil --set HostName "NAME"
sudo scutil --set LocalHostName "NAME"