Skip to content

Instantly share code, notes, and snippets.

View kidpollo's full-sized avatar
💁‍♂️
Potato farming

Paco Viramontes kidpollo

💁‍♂️
Potato farming
  • San Francisco, CA
View GitHub Profile
def descerebrado
@sentido_comun -= @tacto + @delicadeza
end
descerebrado == pendejo
#True
def search(options = {})
search = false
blocked_domains_filter = ""
blocked_channels_filter = ""
if options[:jobseeker]
blocked_domains_filter = " not ( " + options[:jobseeker].blocked_domains.map{|bd| bd.domain}.join(" or ") + " )" unless options[:jobseeker].blocked_domains.empty? || self.keywords.blank?
blocked_channels_filter = " not ( " + options[:jobseeker].blocked_channels.map{|bd| bd.channel}.join(" or ") + " )" unless options[:jobseeker].blocked_channels.empty? || self.keywords.blank?
end
#begin
if !self.placemark.nil?
class CalendarMonthsController < ApplicationController
caches_embedded :mini_calendar, :ttl => 60.minutes
def mini_calendar
user_id = params[:user_id]
@month_offset = params[:month_offset] ? params[:month_offset].to_i : 0
@year = Date.today.year
@month = Date.today.to_time.advance(:months => @month_offset).to_date.month
def current_account_controller_access
@current_account_controller_access ||= Hash[*current_account.features.collect{|feature| [feature.controller_name, feature.actions] }.flatten]
end
require 'rest_client'
require 'json'
###################
# CONF #
###################
# The smallest amount of changed documents before the views are updated
MIN_NUM_OF_CHANGED_DOCS = 10
########### pio.la
# => Ver Configuracion
# cat /usr/local/mongodb/mongod.conf
# => Iniciar mongo
# sudo mongod --config /usr/local/mongodb/mongod.conf
require "mongomapper"
MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017)
MongoMapper.database = 'piola'
# usage:
# field_labeled('Select your address').should have_option("Home Address")
Spec::Matchers.define :have_option do |expected|
def options_for(select_field)
select_field.options.map(&:inner_text)
end
match do |select_field|
raise "Field is not a SelectField" unless select_field.kind_of?(Webrat::SelectField)
options_for(select_field).include?(expected)
if ($host ~* ^([^.]+\.[^.]+)$) {
set $host_without_subdomain $1;
rewrite ^\/(\w+)(\/.*)$ http://$1.$host_without_subdomain$2 break;
}
upstream example {
server unix:/data/example/shared/tmp/pids/example.sock;
}
server {
listen 80;
server_name *.example.com;
root /data/example/current/public;
# full reinstall mysql server
apt-get remove --purge 'mysql-server.*'
rm -rf /etc/mysql
rm -rf /var/run/mysqld
rm -rf /db/mysql
rm -rf /db/mysql
rm -rf /var/lib/mysql
apt-get install mysql-server