Skip to content

Instantly share code, notes, and snippets.

@arunthampi
arunthampi / README.md
Last active February 2, 2018 23:15 — forked from jmhobbs/README.md
Create scrolling text gifs for Slack

Makes little scrolly text jiffs in Flywheel colors.

Prerequisites

  • imagemagick brew install imagemagick
  • gifsicle brew install gifsicle
  • u r on a mac

Usage

@arunthampi
arunthampi / game.rb
Created April 24, 2017 01:10
Mine Sweeper Game
class Cell
attr_accessor :has_mine, :revealed
def initialize(has_mine, grid, row, col)
self.has_mine = has_mine
self.revealed = false
@row = row
@col = col
@grid = grid
end
class Team < ActiveRecord::Base
def import_users!
return if bot.blank?
slack_client = Slack.new(bot.token)
Team.with_advisory_lock("team-import-#{self.uid}") do
object_nesting_level = 0
current_user = {}
current_profile = {}
require 'uri'
class Slack
API_URL = ENV['SLACK_API_URL']
def initialize(token)
@token = token
end
def call(slack_api, method, params = {}, &block)
require 'rubygems'
require 'excon'
def download_file(url, source_path = nil)
error = nil
if source_path.nil?
source_path = File.join("/tmp", "output")
end
@arunthampi
arunthampi / wufoo.css
Created July 16, 2013 00:00
Nitrous:Enterprise wufoo css
/* Backgrounds */
html {
background-color: white;
}
.wufoo {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
}
@arunthampi
arunthampi / gist:5271762
Created March 29, 2013 16:05
bundle exec kitchen test
Aruns-MacBook-Air:bluepill arun$ bundle exec kitchen list
/Users/arun/.rvm/gems/ruby-1.9.3-p392/bundler/gems/test-kitchen-847540a8d8aa/lib/kitchen/shell_out.rb:73:in `rescue in run_command': Expected process to exit with [0], but received '1' (Kitchen::ShellOut::ShellCommandFailed)
---- Begin output of vagrant --version ----
STDOUT:
STDERR: Vagrant failed to initialize at a very early stage:
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
@arunthampi
arunthampi / foobar_config.yml
Created November 28, 2012 03:48
foobar_config.yml
---
vars_files:
# This will create a file called github_private_key.yml (since the context is set to global)
# and will look like this:
#---
#github_private_key: blabla
#
# bombay will include these vars_files while invoking ansible-playbook
github_private_key:
context: global
@arunthampi
arunthampi / install_node_via_nvm.yml
Created November 25, 2012 16:02
install_node_via_nvm.yml
---
- name: Clone NVM
action: git repo=git://github.com/creationix/nvm.git dest=/home/${user}/.nvm
- name: Download Node.JS 64-bit
action: get_url url=http://nodejs.org/dist/${version}/node-${version}-linux-x64.tar.gz dest=/home/${user}/.nvm/node-${version}-linux-x64.tar.gz
- name: Unpack Node
action: command tar -xzf node-${version}-linux-x64.tar.gz creates=/home/${user}/.nvm/${version} chdir=/home/${user}/.nvm
fatal: [192.168.254.254] => Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/ansible/runner/__init__.py",
line 427, in _executor
exec_rc = self._executor_internal(host)
File
"/usr/local/lib/python2.7/dist-packages/ansible/runner/__init__.py",
line 478, in _executor_internal
return self._executor_internal_inner(host, inject, port)
File