This file contains 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
bundle exec rails webpacker:binstubs |
This file contains 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
this.setState({ makeCalls: true }, () => { | |
console.log("makeCalls: ", this.state.makeCalls) | |
} | |
) |
This file contains 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
SELECT * FROM schema_migrations; | |
DELETE FROM schema_migrations WHERE version IN (<version>); |
This file contains 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
#strip whitespace from headers | |
CSV.foreach("tmp/client_mapping.csv", {headers: true,:header_converters=> lambda {|f| f.strip}) do | |
end |
This file contains 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
# Application controller | |
def user_root_path | |
your_url_here | |
end |
This file contains 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
sudo service redis-server stop |
This file contains 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
pg_ctl -D /usr/local/var/postgresql@version start | |
pg_ctl -D /usr/local/var/postgresql@version stop |
This file contains 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
@avg_score_hash = Hash.new { |hash, key| hash[key] = [] } | |
@rows.each do |row| | |
row.last.each_with_index do |column, index| | |
if column != 0 | |
@avg_score_hash[index] << column | |
end | |
end | |
end | |
@avg_score_hash | |
This file contains 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
class ArrayFlattener | |
#recursive function | |
def flatten_this(arr) | |
raise ArgumentError, 'Argument is not an array' unless arr.is_a? Array | |
arr.each_with_object([]) do | element, flat_array | | |
flat_array.push *( element.is_a?(Array) ? flatten_this(element) : element ) | |
end | |
end |
This file contains 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
sudo -u postgres psql | |
psql -d template1 |