Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# Example: | |
# Adding unique index on user_id(existing foreign_key) of kycs table | |
class AddUniqueIndexOnUserIdToKycs < ActiveRecord::Migration[6.0] | |
def change | |
remove_foreign_key :kycs, :users | |
remove_index :kycs, :user_id | |
add_index :kycs, :user_id, unique: true | |
add_foreign_key :kycs, :users | |
end | |
end |
sudo apt install apache2
sudo systemctl enable apache2
sudo service apache2 status
sudo ufw app list
sudo ufw allow in "Apache Full"
sudo a2enmod rewrite
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
Copy data from one table to another table, and insert it.
INSERT INTO destination_table(
col1, col2, col3, col4, col5, col6
)
SELECT col1, col2, col3, 'custom_value' as col4, col5, col6
FROM source_table;
models = Model.all.group_by{|model| [model.attr1,model.attr2,model.attr3] }; nil
models.values.each do |duplicates|
first_one = duplicates.shift
duplicates.each{|double| double.destroy} # duplicates can now be destroyed
end
{ | |
"HTML": { | |
"beautifiers": [ | |
"Pretty Diff", | |
"JS-Beautify" | |
], | |
"indent_size": 2, | |
"indent_style": "space", | |
"max_preserve_newlines": 0, | |
"multiline_ternary": "never", |
#!/bin/sh | |
target_env=$1 | |
profile=$2 | |
REPO="https://gitlab.com/namespace-inc/corporate" | |
SLACK_URL="https://hooks.slack.com/services/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" | |
CHANNEL="#corporate" | |
BOTNAME="deployer" |
'use strict'; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; | |
exports.handler = (event, context, callback) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; |