REVOKE CONNECT ON DATABASE [DATABASE_NAME] FROM public;DROP DATABASE [DATABASE_NAME];
redis-cli FLUSHALL
redis-cli FLUSHDB
redis-cli -n <database_number> FLUSHDBRef: https://www.shellhacks.com/redis-delete-all-keys-redis-cli/
a = ["A", "B", "C", "B", "A"]
a.detect{ |e| a.count(e) > 1 }| { | |
| "response": { | |
| "status": 200, | |
| "message": "OK", | |
| "url": "http://localhost:3000/api/v1/mixed/countries" | |
| }, | |
| "data": [ | |
| { | |
| "country_data_or_code": { | |
| "continent": "South America", |
/*
* parse_link_header()
*
* Parse the Github Link HTTP header used for pageination
* http://developer.github.com/v3/#pagination
*/
function parse_link_header(header) {
if (header.length == 0) {
throw new Error("input must not be of zero length");| [Desktop Entry] | |
| Encoding=UTF-8 | |
| Version=1.0 | |
| Type=Application | |
| Name=Postman | |
| Icon=/home/sundi3yansyah/Src/postman/app/resources/app/assets/icon.png | |
| Path=/home/sundi3yansyah/Src/postman | |
| Exec=/home/sundi3yansyah/Src/postman/Postman | |
| StartupNotify=false | |
| StartupWMClass=Postman |
| class ImagesController < ActionController::Base | |
| skip_before_action :verify_authenticity_token | |
| def create | |
| @image = Image.new(image_params) | |
| if @image.save | |
| render json: { url: @image.image_url(:original) }, status: 201 | |
| else | |
| render json: { message: @image.errors.full_messages.first }, status: 422 |
chown -R $(whoami) ~/.gnupg
find ~/.gnupg -type f -exec chmod 600 {} \;
find ~/.gnupg -type d -exec chmod 700 {} \;
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |