Skip to content

Instantly share code, notes, and snippets.

View mfo's full-sized avatar
💭
part time available for intersting projects

mfo mfo

💭
part time available for intersting projects
View GitHub Profile
@mfo
mfo / gist:857274
Created March 6, 2011 13:13
[polyfills] sass & css3pie for border radius, box shaddow
View gist:857274
/*
info:
http://sass-lang.com/
group of css3pie mixins: http://css3pie.com/demos/tabs/
define browser compliant shortcut for:
- border-radius
- box-shaddow
*/
/*
desc: css3pie_box_shaddow apply a box-shaddow with css3pie 'framework'
@mfo
mfo / gist:857280
Created March 6, 2011 13:19
[IE Testing] Virtual box install with an MS ISO for Vista
View gist:857280
# install wine, Download on MS a virtual machine dedicated to IE.
sudo aptitude install wine virtualbox-ose
# Go on http://www.microsoft.com/downloads/en/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en
# get iso that is interesting for you
wine /home/mfo/Downloads/IE7-VIS1.exe
# convert MS format to virtual box, may take some time
VBoxManage clonehd Vista\ Business\ with\ IE7.vhd ie7.vdi --format vdi
@mfo
mfo / gist:857283
Created March 6, 2011 13:22
RVM + gemset with a ruby-1.9.2... crappy with ubuntu...
View gist:857283
# setup rvm gemset
sudo rvm install ruby-1.9.2-p136
sudo rvm use ruby-1.9.2-p136@my_gemset --create
# setup apt repo and download needed lib in order to compile ruby1.9.2
sudo add-apt-repository ppa:ubuntu-on-rails/ppa
sudo apt-get update
sudo apt-get install libopenssl-ruby1.9.2 libxslt-dev libxml2-dev sqlite3 libsqlite3-dev
# extract package with rvm in the gemset
View gist:857397
<!-- css .nested1 .nested2 => la div nested2 -->
<div class"nested1">
<div class="nested2">
</div>
</div>
<!-- css .chained1.chained2 => la div qui possede les deux classes => je sais pas si IE tolererait -->
<div class"chained1 chained2">
<div>
@mfo
mfo / gist:857829
Created March 6, 2011 22:56
popin-refactor
View gist:857829
- # dont think to much :-) keep it simple and embrace jQuery UI component lib
%li
%ul#c_evt_popin
%li.author= "event creator: #{@event.owner.email}"
%li.created_at= "created on: #{@event.created_at}"
%li.nbpict= "event photos: "
%li.nbpict= "event date: "
%li.nbpict= "contributors: #{@event.sources.size}"
-content_for :additional_bottom_js do
@mfo
mfo / gist:872887
Created March 16, 2011 17:32
# install IE testing environment on a mac
View gist:872887
# mac version...
brew install wine
# download an ISO of xp : http://www.microsoft.com/downloads/en/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en
wine XPSP3_IE.exe # wine will ask an output folder for a .vhd file
# download a VM img converter : http://www.kju-app.org/
# convert the img
/Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk -f vpc ./IE8Compat.vhd ./xp_sp3_ie_tester.vmdk
@mfo
mfo / gist:874019
Created March 17, 2011 08:54
from emacs to textmate
View gist:874019
# set dir which store Bundles : http://manual.macromates.com/en/bundles
mkdir -p /Library/Application\ Support/TextMate/Bundles
cd /Library/Application\ Support/TextMate/Bundles
# get some bundles for rails
svn co "http://svn.textmate.org/trunk/Bundles/Ruby Haml.tmbundle"
svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby Sass.tmbundle"
git clone git://github.com/kuroir/SCSS.tmbundle.git "SCSS.tmbundle"
# open your rails project, menu => Bundles => Bundle Editors => Reload Bundles
View secu power
# find a keychain
!security 2>&1 >/dev/null find-generic-password -gs \"GitHub\" | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'
View gist:1033248
# coffee bootstrap
# http://arcturo.com/library/coffeescript/05_applications.html
# installing node : http://shapeshed.com/journal/setting-up-nodejs-and-npm-on-mac-osx/
brew install node
curl http://npmjs.org/install.sh | sh
npm install -g spine.app
npm install stitch
npm install request
npm install less
View working with indexes in mongo db
from mongo console :
# a few usefull command on mongo cli
show dbs
use sharypic_development
# adding sparse index
db.users.dropIndex("invite_code_1")
db.users.ensureIndex({invide_code: 1}, {sparse: true, unique: true})
# rename a datbase