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
cf: http://www.linuxquestions.org/questions/linux-software-2/using-chmod-to-recursively-change-directories-files-293310/ | |
find [YOURDIR] -type d -exec chmod 755 {} \; | |
find [YOURDIR] -type f -exec chmod 644 {} \; |
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
Asynchronous programming | |
JavaScript: | |
var a = 'foo'; | |
//lots of code | |
setTimeout(function(){ //Beginning of code that should run AFTER the timeout | |
alert(a); | |
//lots more code | |
},5000); | |
alert('before foo'); |
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
// http://www.davidflanagan.com/javascript5/display.php?n=8-7&f=08/07.js | |
// This function implements a breakpoint. It repeatedly prompts the user | |
// for an expression, evaluates it with the supplied self-inspecting closure, | |
// and displays the result. It is the closure that provides access to the | |
// scope to be inspected, so each function must supply its own closure. | |
// | |
// Inspired by Steve Yen's breakpoint() function at | |
// http://trimpath.com/project/wiki/TrimBreakpoint | |
// |
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
@font-face { | |
font-family: 'DroidSansRegular'; | |
src: url('fonts/DroidSans-webfont.eot'); | |
src: local('☺'), url('fonts/DroidSans-webfont.woff') format('woff'), url('fonts/DroidSans-webfont.ttf') format('truetype'), url('fonts/DroidSans-webfont.svg#webfontw7zqO19G') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
@font-face { | |
font-family: 'DroidSansBold'; | |
src: url('fonts/DroidSans-Bold-webfont.eot'); |
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> | |
<a href="#" class="button"><span>Do Not Press This Button</span></a> | |
</div> | |
*/ | |
.button { | |
display: inline-block; | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; |
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> | |
<a href="#" class="abbey"> | |
<img src="SaintMichaelAbbey.jpg" alt="Saint Michel Abbey, France"> | |
Saint Michel Abbey, France | |
</a> | |
</div> | |
*/ | |
body { |
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
#tabs ul { | |
margin: 10px; | |
padding-left: 0; | |
display: inline-block; | |
} | |
#tabs ul li { | |
list-style: none; | |
float: left; | |
} |
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
Pry.config.editor = "mvim" | |
# Launch Pry with access to the entire Rails stack. | |
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
# If you don't, you can load it through the lines below :) | |
rails = File.join Dir.getwd, 'config', 'environment.rb' | |
if File.exist?(rails) && ENV['SKIP_RAILS'].nil? | |
require rails |
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
# dans application_controller | |
private | |
# Charge le layout qui porte le même nom que le Namespace | |
# retourne aucun layout si la requête est en AJAX | |
def choose_layout | |
namespace = self.class.name.split("::").first.downcase | |
(request.xhr?) ? nil : namespace | |
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
<% field_with_errors @zonage, :name do %> | |
<div class="control-group"> | |
<%= f.label 'Nom du zonage', :class => 'control-label' %> | |
<div class="controls"> | |
<%= f.text_field :name %> | |
</div> | |
</div> | |
<% end %> |
OlderNewer