Skip to content

Instantly share code, notes, and snippets.

View rilian's full-sized avatar

rilian rilian

View GitHub Profile

Commandline output

$ ruby treetoar.rb 
SELECT "topics".* FROM "topics"  WHERE "topics"."id" = 1
Topic.where(id: 1)
SELECT "topics".* FROM "topics"  WHERE "topics"."id" IN (1, 2, 3)
Topic.where(id: [1, 2, 3])
@rilian
rilian / xvfb
Created January 28, 2014 19:39 — forked from jterrace/xvfb
export DISPLAY=localhost:1.0
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
CREATE FUNCTION batch_at_will() RETURNS INTEGER LANGUAGE plpgsql AS $$
DECLARE batched_count INTEGER = 1;
BEGIN
WITH selected_users AS (
SELECT id
FROM users
WHERE role = 'moderator'
AND registration_date < CURRENT_DATE - INTERVAL '4' YEAR
LIMIT 1000
FOR UPDATE NOWAIT

Flux and Flux-like Options

A non-exhaustive list of flux and flux-like libraries with relevant information and notes.

Library Stars Latest Release
Facebook flux
reflux
fluxxor
marty [](https:/
Name Price Integrations Limits Language
bugsnag.com $29 per month slack, jira 5 devs javascript, php
speedcurve.com $0.01 per check slack, jira - javascript
honeybadger.io $44 per month slack, jira 5 projects javascript
atatus.com $29 per month slack, jira 200000 view/month javascript
muscula.com $14 per month - 1 000 000 errors/month javascript
exceptional.io - - - -
airbrake.io $39 per month slack, jira 5 projects, 10 users javascript, php
errorception.com $29 per month slack, jira
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@rilian
rilian / slack_delete.rb
Created September 29, 2016 12:52 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
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,
@rilian
rilian / config-environments-test.rb
Last active October 5, 2019 07:49 — forked from keithtom/no_animations.rb
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
Rails.application.configure do
# ...
require_relative '../../spec/support/no_animations'
config.middleware.use Rack::NoAnimations
end
@rilian
rilian / gist:12dcdaded69b5cd26ccf204188c3c6d9
Created July 17, 2017 10:00 — forked from stiucsib86/gist:ebff282a3989f9a24117
Backup MySQL dump to Azure Storage
#!/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
@rilian
rilian / slackpost
Created February 20, 2018 14:05 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/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