This file contains hidden or 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
#!/bin/bash | |
# Usage: slackpost <token> <channel> <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
slackhost=PUT_YOUR_HOST_HERE | |
token=$1 |
This file contains hidden or 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
#!/bin/sh | |
mkdir /home/bitnami/backups/ | |
export BACKUP_FILE=/home/bitnami/backups/db-backup.sql.gz | |
export DATABASE_SCHEMA_NAME=--all-databases | |
export AZURE_CONTAINER=YOUR_VALUE_HERE | |
export AZURE_NAME=YOUR_VALUE_HERE | |
export AZURE_KEY=YOUR_VALUE_HERE | |
export AZURE_BLOB_NAME=db-production-$(date +%Y%m%d%H%M%S).sql.gz |
This file contains hidden or 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
/** | |
* based on a work of | |
* https://webapps.stackexchange.com/questions/50511/pass-range-in-google-apps-script-custom-function-without-using-a1-notation | |
* | |
* Counts cell values in a range if they have the given background color | |
* =countByColor("A5", ROW(A5)) | |
* | |
* @param {String} cell reference to get color | |
* @param {int} startrow reference to the row to calculate count | |
* @return {int} Count of all cell values matching the condition |
This file contains hidden or 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
task non_digested: :environment do | |
assets = Dir.glob(File.join(Rails.root, 'public/assets/**/*')) | |
regex = /(-{1}[a-z0-9]{32}*\.{1}){1}/ | |
assets.each do |file| | |
next if File.directory?(file) || file !~ regex | |
source = file.split('/') | |
source.push(source.pop.gsub(regex, '.')) | |
non_digested = File.join(source) |
This file contains hidden or 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
# Display the current tcp_keepalive_time value. | |
$ cat /proc/sys/net/ipv4/tcp_keepalive_time | |
# Set tcp_keepalive_time to 60 seconds and make it permanent across reboots. | |
$ echo 'net.ipv4.tcp_keepalive_time = 60' | sudo tee -a /etc/sysctl.conf | |
# Apply the change. | |
$ sudo /sbin/sysctl --load=/etc/sysctl.conf | |
# Display the tcp_keepalive_time value to verify the change was applied. |
This file contains hidden or 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
Rails.application.configure do | |
# ... | |
require_relative '../../spec/support/no_animations' | |
config.middleware.use Rack::NoAnimations | |
end |
This file contains hidden or 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
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
pg_version=${1:-'9.5'} | |
echo "Installing PostgreSQL version: $pg_version" | |
sudo apt-get update -q | |
sudo apt-get -y install postgresql-client-$pg_version postgresql-$pg_version postgresql-contrib-$pg_version postgresql-server-dev-$pg_version libpq-dev postgresql-$pg_version-postgis-2.2 |
This file contains hidden or 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
https://github.com/activerecord-hackery/ransack/issues/169 | |
https://github.com/activerecord-hackery/ransack/issues/211 | |
https://github.com/activerecord-hackery/ransack/issues/218 | |
https://github.com/activerecord-hackery/ransack/issues/219 |
This file contains hidden or 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
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |