Skip to content

Instantly share code, notes, and snippets.

View derkhadim's full-sized avatar
🏠
Working from home

Mouhamadou DER derkhadim

🏠
Working from home
View GitHub Profile
@tenken
tenken / shortprofile.info
Created March 29, 2012 22:17
A Sample short profile that auto-fills the DB form, its a little ugly.
; dpg ::: http://drupal.org/user/1059226
; Example Short Profile -- hides database configuration page.
;
; This bears mentioning more than once. See http://drupal.org/node/1153646
name = Short Profile
description = A short profile, it removes DB settings page.
core = 7.x
dependencies[] = block
@gabceb
gabceb / gist:5113767
Created March 8, 2013 02:27
Handling 404, 401 and 500 exceptions on Rails
class ApplicationController < ActionController::Base
unless Rails.application.config.consider_all_requests_local
#rescue_from Exception, with: :render_500
rescue_from ActionController::RoutingError, with: :render_canvas_404
rescue_from ActionController::UnknownController, with: :render_404
rescue_from AbstractController::ActionNotFound, with: :render_404
rescue_from ActiveRecord::RecordNotFound, with: :render_404
rescue_from ActiveResource::ForbiddenAccess, with: :render_403
end
@jslegers
jslegers / style.scss
Created July 26, 2013 13:24
A CodePen by Hugo Giraudel. Sass mixin for scrollbar styling - Because I can't ever remember the right syntax for scrollbars styling in WebKit, here is a little Sass mixin to do it for you.
@import "compass";
/**
* Mixin scrollbar
*/
@mixin scrollbar($size, $primary, $secondary: lighten($primary, 25%)) {
::-webkit-scrollbar {
width: $size;
height: $size;
}
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@seyhunak
seyhunak / seeds.rb
Created December 7, 2013 14:54
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
fr:
admin:
js:
true: Vrai
false: Faux
is_present: Est présent
is_blank: Est vide
date: Date ...
between_and_: Entre le ... et le ...
today: "Aujourd'hui"
@vitorbritto
vitorbritto / add_apache_brew.md
Last active March 4, 2019 10:30
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@caike
caike / todo.jsx
Created April 11, 2015 13:02
Simple Todo app demo using React + ES6
var React = require("react");
var allItems = []
allItems.push("Buy ingredients for Crock Pot");
allItems.push("Pick up chair at IKEA");
allItems.push("Go see mom");
class TodoList extends React.Component {
constructor(props){
super(props);
@qsypoq
qsypoq / devise.fr.yml
Last active October 19, 2018 09:10 — forked from GRoguelon/devise.fr.yml
French translation of devise.en.yml (version: 3.5.3).
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
fr:
devise:
confirmations:
confirmed: "Votre compte a été validé."
send_instructions: "Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes."
send_paranoid_instructions: "Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte."
failure:
already_authenticated: "Vous êtes déjà connecté"
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :