Skip to content

Instantly share code, notes, and snippets.

Alexa, ask the future of America to be great again! (try it)

Daniel Doubrovkine (dB.) @dblockdotorg dblock

Alexa, ask the future of America to be great again! (try it)
Block or report user

Report or block dblock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5f97961819d4c2162abdcd5e4712f2ff
Create Element:
$Rainb.el('div',{'attribute':"value",style:{"color":"red"}},[ (childnodes) ])
becomes: <div attribute="value" style="color: red;"></div>
Append Element
Get Element By Id
Create TextNode
dblock / test.rb
Created Aug 13, 2018
Kramdown parser repro
View test.rb
require 'kramdown'
text = <<-MARKDOWN
# Example
The quick brown fox jumps over the lazy dog.
# one
dblock /
Created Jun 20, 2018
Restart all the bots.
for D in `find . -type d -name "*bot"`
NAME=`basename $D`
echo Restarting $NAME ...
dokku ps:restart $NAME
View mongoid-collection-snapshot-nil.rb
require 'mongoid'
require 'mongoid-collection-snapshot'
Mongo::Logger.logger.level = Logger::INFO
Mongoid.connect_to 'widgets-and-gadgets', max_pool_size: 16
class Widget
include Mongoid::Document
View notify-bot-teams.rb do |team|
next if team.premium
STDOUT.write "#{}: "
client = team.token)
channels = client.channels_list['channels'].select { |channel| channel['is_member'] }
channels.each do |channel|
STDOUT.write "#{channel['name']} "
dblock / try.rb
Created Jun 14, 2016
Slack celluloid connection test.
View try.rb
require 'celluloid/current'
require 'celluloid/io'
require 'http'
require 'websocket/driver'
class Connection
include Celluloid::IO
extend Forwardable
def initialize(url)
dblock /
Created Feb 15, 2016
Auto-start Dropbox.
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
if [ -x $HOMEDIR/$DAEMON ]; then
HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
dblock /
Last active Jul 3, 2018
Backup MongoDB databases with Dropbox and Dokku
echo "Backing up MongoDB databases to Dropbox ..."
dt=$(date +"%Y-%m-%d")
echo " today is $dt"
echo " creating $BACKUP_PATH .."
dblock / Gemfile
Created May 15, 2015
Grape on Goliath
View Gemfile
source ''
gem 'grape'
gem 'goliath'
gem 'json'
You can’t perform that action at this time.