Skip to content

Instantly share code, notes, and snippets.

View gmas's full-sized avatar

George Masgras gmas

  • Barcelona
  • 16:15 (UTC +02:00)
View GitHub Profile
Snippet development
Quickly finding snippets
There are some ways you can quickly find a snippet file:
*
M-x yas/new-snippet
Prompts you for a snippet name, then tries to guess a suitable directory to store it, prompting you for creation if it does not exist. Finally, places you in a new buffer set to snippet-mode so you can write your snippet.
@lxneng
lxneng / gist:741932
Created December 15, 2010 13:21
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
@ysawa
ysawa / .vimrc
Created October 12, 2011 14:31
converting ruby old hash syntax to new one
function! RubyNewHashSyntax()
:%s/:\(\w\+\) =>/\1:/ge
endfunction
command! RubyNewHashSyntax :call RubyNewHashSyntax()
@liaody
liaody / coffeescript_gotcha.md
Created January 12, 2012 01:56
Coffeescript gotchas when migrating from javascript

Here are some of the "gotchas" I've encountered when I converted all the javascript code into coffeescript. (BTW, this is gathered while coding for YourMechanic.com, a very cool mobile auto repair service.)

Disclaimer: Coffeescript is a great productivity booster for me personally. Even with all the things outlined below, it is still way better than javascript. None of these should discourage you from jumping into it right away.

Major gotchas

(Things that generate wrong code silently)

@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@santoshrajan
santoshrajan / server.ls
Created August 11, 2012 05:52
A LispyScript Server example with nodejs, expressjs, twitter bootstrap
;; http://lispyscript.com
;; LispyScript example using nodejs, expressjs and twitter bootstrap
;; LispyScript templates are written in LispyScript!
;; Html5 templates support all html5 tags
;; The express server
(var express (require "express"))
(var app (express))
(app.listen 3000)
anonymous
anonymous / gist:4277829
Created December 13, 2012 16:46
Ruby Garbage Collector not garbage collecting as expected
class Person
def self.destructor name
proc{ puts "I AM DYING: #{name}"}
end
attr_reader :name
def initialize name
@name = name
ObjectSpace.define_finalizer self, Person.destructor(name)
def required(arg=nil)
method = caller_locations(1,1)[0].label
raise ArgumentError.new("required parameter #{arg.to_sym.inspect + ' ' if arg}not passed to method #{method}")
end
def say(greeting: required('greeting'))
puts greeting
end
def say2(greeting: required)
@willurd
willurd / web-servers.md
Last active June 21, 2024 13:36
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active May 14, 2024 15:14
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install