This file contains hidden or 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
| [user] | |
| name = Alexandre Croteau-Pothier | |
| email = alexcp.com@gmail.com | |
| [color] | |
| ui = true | |
| [alias] | |
| ci = commit | |
| co = checkout | |
| di = diff | |
| aa = add --all |
This file contains hidden or 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
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $syslog | |
| # Required-Stop: $syslog | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |
This file contains hidden or 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
| def distance_of_time_in_days(from_time, to_time = 0) | |
| from_time = from_time.to_time if from_time.respond_to?(:to_time) | |
| to_time = to_time.to_time if to_time.respond_to?(:to_time) | |
| from_time, to_time = to_time, from_time if from_time > to_time | |
| distance_in_days = (((to_time - from_time).abs) / 86400).round | |
| end |
This file contains hidden or 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
| user www-data; | |
| worker_processes 1; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 768; | |
| # multi_accept on; | |
| } | |
| http { |
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| set -e | |
| . /lib/lsb/init-functions | |
| start() { | |
| echo "Starting the Rails Server.." | |
| cd /home/operation/server/operation/current && bundle exec thin start -e production -s3 |
This file contains hidden or 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
| Dir.foreach("src") do |filename| | |
| unless filename == "." or filename == ".." | |
| newfilename = "src/#{filename}.utf8" | |
| filename = "src/#{filename}" | |
| p `iconv -f iso-8859-1 -t utf-8 #{filename} > #{newfilename}` | |
| end | |
| end |
This file contains hidden or 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
| function rh() { | |
| case $1 in | |
| n) | |
| rhythmbox-client --next | |
| ;; | |
| pr) | |
| rhythmbox-client --previous | |
| ;; | |
| p) | |
| rhythmbox-client --play-pause |
This file contains hidden or 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
| package refactoring; | |
| public class Commande { | |
| public int id; | |
| public int montant; | |
| public int date; | |
| public Commande(int id,int montant,int date){ | |
| this.id = id; | |
| this.montant = montant; |
This file contains hidden or 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 | |
| MINUTE = 60 | |
| HOUR = 3600 | |
| def sudome | |
| if ENV["USER"] != "root" | |
| exec("sudo #{ENV['_']} #{ARGV.join(' ')}") | |
| end | |
| end |
This file contains hidden or 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
| module DelayedPaperclip | |
| module Jobs | |
| class DelayedJob | |
| def perform | |
| DelayedPaperclip.process_job(instance_klass, instance_id, attachment_name) | |
| clear_cache(instance_klass, instance_id) | |
| end | |
| def clear_cache(instance_klass, instance_id) | |
| begin |
OlderNewer