# create an SSL folder for your environment.
mkdir -p ~/.ssl/development/
cd ~/.ssl/development/
# create private key / certificate for your app
# /!\ remember to define the expected common name for you development hostname [if your using localhost, use localhost. If you are using a custom domain, use it]
openssl genrsa -out my_app_key.pem 1024
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
myapp.mymodule = do -> | |
privateStuff = myPrivateVarOrMethod | |
publicReturnedObject = | |
publicProperty: undefined, | |
publicMethod: -> | |
console.log 'do something' |
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
myFunc = (param1, params2) -> console.log 'okok'; return; | |
//when it will be "compiled", i will look like as : | |
myFunc = function() { console.log('okok'); |
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 | |
# usage in the real life: | |
# when you want to compare changes between your development version and a production version : | |
# webdiff http://sharypic.com http://sharypic-dev.com:3000 | |
# | |
# into the wild: | |
# create a 'test suite' of your full website :-) [i'll parse my sitemap.xml] | |
require 'fileutils' |
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
# dropdb from console | |
$> mongo --eval "db.dropDatabase();" databasename | |
# restore a db from a backup | |
$> mongorestore -vvv sharypic_development | |
# run mongo console | |
$> mongo | |
# a few usefull command on mongo cli |
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
# it's an IIFE (Immediately-Invoked Function Expression) expeting jQuery as argument | |
(($) -> | |
# by default, i'm expecting window.sharypic declared as a namespace to declare a new class | |
class window.sharypic.WidgetTrackr | |
# should be called one time, and inserting / creating [or not], a new GA trackr | |
constructor: -> @insert() | |
# insert the google tracking code inside the webpage | |
insert: -> | |
window._gaq = window._gaq || []; |
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
<div class="sharypic_widget" data-sharypic-uid='4sacwgos3b8s8w46' style='height: 240px; width: 320px;'/> | |
<script language='javascript'> | |
(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://js.sharypic.com/widget-loader-1.0.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})() | |
</script> |
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
# $HOME/.config/coolline/coolline.rb, see https://github.com/Mon-Ouie/coolline#configuration | |
Coolline.bind "\C-z" do |cool| | |
`kill -s TSTP #{Process.pid}` | |
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 Api::CollectionsController < ApplicationController | |
def update | |
@collection = Collection.where(pname: params[:id], event_id: @event.id).first | |
@collection.assign_to(@event, params[:collection]) | |
@status = @collection.save! ? "ok" : "ko" | |
render status: 200 | |
rescue Exception => e | |
@status = "ArgumentError" | |
@error = @collection.errors.keys |
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
grep -r "fa-" \ | |
--include=\*.{rb,haml,jst,js} \ | |
--exclude=\*xregexp\* \ | |
--exclude-dir={public,.//app/assets/javascripts/i18n,.//app/assets/javascripts/i18n/web} \ | |
./ \ | |
> icons.txt | |
ruby -e 'File.read("./icons.txt").scan(/(fa(?:-\w+)+)/).flatten.uniq' |