⌘⇡ | Go to Enclosing Folder |
⌘⇣ | Open |
⌘⇠ | Go Back |
⌘⇢ | Go Forward |
↩ | Rename |
␣ | QuickLook |
⇧⌘N | New Folder |
⌥⌘N | New Tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/hosts: | |
127.0.0.1 myhost jboss_server | |
NGINX: | |
server { | |
listen myhost:80; | |
server_name myhost; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming running script from home dir, with local.rb inside the backup folder, load it: | |
require 'Backup/local' | |
Backup::Model.new(:my_backup, 'My Backup') do | |
archive :vim do |archive| | |
archive.add '/Users/mike.frawley/.vim' | |
end | |
store_with ::Backup::Storage::Local do |local| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
@name = nil | |
# class-level reader | |
# cattr_accessor is rails-specific not ruby, and uses class vbles so ... | |
# may be done like this too: | |
# | |
# class << self | |
# attr_reader :name | |
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: jboss | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/Stop JBoss AS v7.0.0 | |
### END INIT INFO | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# gem install grape --pre | |
# http://localhost:9000/hello.json | |
# => {"hello":"world"} | |
$:<< '../lib' << 'lib' | |
require 'goliath' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Angular needs to send the Rails CSRF token with each post request. | |
* | |
* Here we get the token from the meta tags (make sure <%= csrf_meta_tags %> | |
* is present in your layout.) | |
*/ | |
angular.module('myapp',[]). | |
// configure our http requests to include the Rails CSRF token | |
config(["$httpProvider", function(p) { | |
var m = document.getElementsByTagName('meta'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
class << self | |
def add(ele) | |
@array ||= [] | |
@array << ele | |
end | |
def array | |
@array ||= [] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point | |
constructor: (@x = 0, @y = 0) -> | |
if isNaN(@x) or isNaN(@y) | |
throw new Error('Invalid coords') | |
add: (point) -> | |
@x += point.x | |
@y += point.y | |
subtract: (point) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :image_compression do | |
desc 'Optimize images with pngcrush and jpegoptim' | |
task :process do | |
# Check for pngcrush | |
if (!`which pngcrush`.empty? rescue false) # rescue on environments without `which` (windows) | |
# Crush all .png files | |
run "find #{shared_path}/assets/ -type f -name '*.png' -print0 | xargs -0 pngcrush -q -e .crushed" |
OlderNewer