Skip to content

Instantly share code, notes, and snippets.

View fayimora's full-sized avatar
🕺

Fayi FB fayimora

🕺
  • London, England
View GitHub Profile
@fayimora
fayimora / gfm.rb
Created February 26, 2012 15:57 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
Undefined symbols for architecture x86_64:
"CreditCard::CreditCard(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double)", referenced from:
testCard() in ccbBJwte.o
"CreditCard::chargeIt(double)", referenced from:
testCard() in ccbBJwte.o
"operator<<(std::basic_ostream<char, std::char_traits<char> >&, CreditCard const&)", referenced from:
testCard() in ccbBJwte.o
"CreditCard::makePayment(double)", referenced from:
testCard() in ccbBJwte.o
ld: symbol(s) not found for architecture x86_64
def drafts
@posts = Post.where(draft: true)
end
ruby-1.9.2-p290@rvmtest:
system:
uname: "Darwin lt38-201.eecs.qmul.ac.uk 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
rvm:
version: "rvm 1.11.3 () by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.beginrescueend.com/]"
/Users/fayimora/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/fayimora/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/fayimora/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /Users/fayimora/.rvm/gems/ruby-1.9.3-p0/bin/rails:18:in `<main>'
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
# echo "rvm use 1.9.2" > .rvmrc
environment_id="ruby-1.9.2-p290@rvmtest"
@fayimora
fayimora / gist:2568651
Created May 1, 2012 15:08 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
tpope-vim-rails/autoload/rails.vim: if exists("g:loaded_dbext")
tpope-vim-rails/autoload/rails.vim: command! -buffer -bar -nargs=? -complete=customlist,s:Complete_environments Rdbext :call s:BufDatabase(2,<q-args>)|let b:dbext_buffer_defaulted = 1
tpope-vim-rails/autoload/rails.vim:function! s:app_dbext_settings(environment) dict
tpope-vim-rails/autoload/rails.vim: if self.cache.needs('dbext_settings')
tpope-vim-rails/autoload/rails.vim: call self.cache.set('dbext_settings',{})
tpope-vim-rails/autoload/rails.vim: let cache = self.cache.get('dbext_settings')
tpope-vim-rails/autoload/rails.vim: if exists("s:lock_database") || !exists('g:loaded_dbext') || !exists('b:rails_root')
tpope-vim-rails/autoload/rails.vim: call self.cache.clear('dbext_settings')
tpope-vim-rails/autoload/rails.vim: if (!self.cache.has('dbext_settings') || !has_key(self.cache.get('dbext_settings'),env)) && (a:0 ? a:1 : 0) <= 0
tpope-vim-rails/autoload/rails.vim: let dict = self.dbext_settings(env)
@fayimora
fayimora / All.java
Created May 4, 2012 21:04
Multiple java classes in one file.. See revisions!
Copyright (C) 2012 Fayimora Femi-Balogun
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif