This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
server { | |
listen 80; | |
server_name www.myapp.com myapp.com; | |
rewrite ^.* https://myapp.com$request_uri permanent; | |
} | |
server { | |
listen 443; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/sslchain.crt; |
# this is my action mailer setup and can be improved | |
# based on http://broadcast.oreilly.com/2009/03/using-multiple-smtp-accounts-w.html | |
# config/initializer/action_mailer.yml | |
development: | |
default: | |
address: "smtp.provider.com" | |
port: 25 | |
domain: 'mywebsite.com' | |
user_name: '[email protected]' | |
password: '12345' |
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:69:in `join' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:69:in `visit_Arel_Nodes_Values' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/visitor.rb:15:in `visit' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:59:in `visit_Arel_Nodes_InsertStatement' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/visitor.rb:15:in `visit' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/visitor.rb:5:in `accept' | |
[GEM_ROOT]/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:18:in `block in accept' | |
[GEM_ROOT]/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:111:in `with_connection' |
// Orientado a Objeto (Ruby) | |
class Evento | |
def consumir | |
puts "Estou consumido" | |
end | |
end |
<?php | |
// This function extract the rows of arrays like $_FILE when using the option 'multiple' | |
// For ex. | |
// Array | |
// ( | |
// [name] => Array | |
// ( | |
// [0] => uploaded_file1 | |
// [1] => uploaded_file2 | |
// [2] => uploaded_file3 |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php-fpm | |
# Description: starts the PHP FastCGI Process Manager daemon |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
// inicializacao das variavieis | |
char string[100]; | |
char numero_char[6]; | |
int numero = 0; | |
int i = 0; // utilizado para andar pela string digitada pelo usuario | |
int j = 0; // utilizado para andar pelo numero capturado dentro da string |
# Tip for use ctrl + c and ctrl + v on gnome-terminal' | |
$ gconftool-2 -t str -s /apps/gnome-terminal/keybindings/copy "<Control>c" | |
$ gconftool-2 -t str -s /apps/gnome-terminal/keybindings/paste "<Control>v" |
class A | |
attr_accessor :name | |
@@a_classes = [] | |
private_class_method :new | |
def A.find_or_create(name) | |
@@a_classes.each do |klass| | |
if klass.name == name | |
return klass | |
end |