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
def foo(bar, a: 1, b: 2) | |
puts a.inspect | |
end | |
args = { a: 2 } | |
foo(true, args) |
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
/* | |
https://webapps.stackexchange.com/questions/100820/how-do-i-invite-all-team-members-to-a-new-slack-channel#answer-104062 | |
Instructions: Just browse to the appropriate channel and paste | |
this script (below) into your Chrome/Firefox dev console and hit enter. | |
Then wait for the script to run until it completes. | |
It might take time as there is a limit to how many users may be invited at once. | |
The script will loop until all team members are invited. | |
*/ | |
var foundAny=false; | |
function selectAllByLetter(remainingLetters) { |
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
FROM haproxy:latest | |
RUN apt-get update | |
RUN apt-get install -y netcat-openbsd | |
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg | |
EXPOSE 80 |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
"strings" | |
"github.com/PuerkitoBio/goquery" | |
) |
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
FROM ensogo/passenger-ruby23:0.9.18 | |
MAINTAINER [email protected] | |
ENV HOME /root | |
CMD ["/sbin/my_init"] | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
RUN apt-get update | |
# Upgrade Passenger |
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
{ | |
"import_token": "4hSPTrQia5GqfmKm442Rzy7c", | |
"data": [ | |
{ | |
"sku": "P300-1", | |
"name": "T-Shirt", | |
"category": "Fashion", | |
"price": 399, | |
"stock": 24 | |
}, |
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
#!/usr/bin/env bash | |
# Dependencies: | |
# - inotify-tools | |
MY_PIDFILE=tmp/pids/my.pid | |
PUMA_PIDFILE=tmp/pids/puma.pid | |
case $1 in | |
"start") |
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
#!/bin/sh | |
EMAIL= # Your Email | |
ZONEID= # Your zone id, hex16 string | |
RECORDID= # You DNS record ID, hex16 string | |
RECORDNAME= # Your DNS record name, e.g. sub.example.com | |
API= # Cloudflare API Key | |
IP=${1} | |
curl -fs -o /dev/null -XPUT "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID" \ |
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
diff --git a/produce.rb b/produce.rb | |
index 9c531f3..ad34718 100644 | |
--- a/produce.rb | |
+++ b/produce.rb | |
@@ -31,10 +31,11 @@ ActiveRecord::Schema.define do | |
create_table :post_tags, force: true do |t| | |
t.integer :post_id | |
t.integer :tag_id | |
+ t.datetime :created_at | |
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
class Changelog | |
# Put your available versions in the array, in reverse release order, e.g. %w(1.1 1.0 0.9.9999999) | |
VERSIONS = %w().freeze | |
class << self | |
# e.g. Changelog.after('1.0') | |
def after(version) | |
changes = Changelog.new | |
if index = VERSIONS.index(version) | |
VERSIONS[0...index].collect {|v| changes[v] }.flatten |
NewerOlder