Skip to content

Instantly share code, notes, and snippets.

View VictorTpo's full-sized avatar

Victor Thépaut VictorTpo

View GitHub Profile
Account.where("agenda_preferences::json ->> 'features' LIKE '%new-help-center%'")
profile = PublicProfile.first
profile.method(:name).source_location
=> ["/Users/christopher/code/bandc/eden/app/models/public_profile.rb", 30]
GET staging_influence_v2/_settings
POST staging_influence_v2/_close
POST staging_influence_v2/_open
PUT staging_influence_v2/_settings
{
"analysis": {
"normalizer": {
"username_normalizer": {

Apache config

setup

  • the certificate mywebsite-com.crt
  • the key mywebsite-com.key
  • the provider certificate aprovider-com.crt

1. copy files

Disk size

df -h

Repo size

sudo du -h --max-depth=1

Heavy files

sudo find / -size +500M

Log

scope = Celebrity.find(10).tweet
Celebrity Load (0.5ms)  SELECT  `celebrities`.* FROM `celebrities` WHERE `celebrities`.`id` = 10 LIMIT 1
Tweet Load (38.2ms)  SELECT `tweets`.* FROM `tweets` WHERE `tweets`.`celebrity_id` = 10

Before

$ item = Project::Speaker.find(5)
$ item.class.name      
> "Project::Speaker"
$ item.class.name.split('::').first
> "Project"
$ item.class.name.split('::').last
> "Speaker"

It worked !

class Ambassador
  include Searchable
end

class Speaker
  include Searchable
end
@user = User.new(name: '')
[...]
= text_field_tag :pseudo, nil, value: params[:pseudo] || @user.name
# doesn't work :'(

= text_field_tag :pseudo, nil, value: params[:pseudo].present? ? params[:pseudo] : @user.name.present?
# works, but ugly, x2 character count ! :'(