Skip to content

Instantly share code, notes, and snippets.

Dennis Martinez dennmart

Block or report user

Report or block dennmart

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
@dennmart
dennmart / config.yml
Created Apr 26, 2019 — forked from phra/config.yml
Update Chrome to latest version on CircleCI 2.0
View config.yml
- run: #STABLE
name: Install Chromedriver latest version
command: |
sudo apt-get update
sudo apt-get install lsb-release libappindicator3-1
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome.deb
sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
rm google-chrome.deb
@dennmart
dennmart / errbit-heroku.log
Created Jan 5, 2016
Errbit Heroku - Stack Level Too Deep
View errbit-heroku.log
2016-01-05T08:49:34.769952+00:00 heroku[web.1]: State changed from up to starting
2016-01-05T08:49:37.809847+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -c ./config/unicorn.default.rb`
2016-01-05T08:49:38.037022+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-05T08:49:39.010966+00:00 app[web.1]: I, [2016-01-05T08:49:39.010042 #3] INFO -- : reaped #<Process::Status: pid 6 exit 0> worker=0
2016-01-05T08:49:39.011117+00:00 app[web.1]: I, [2016-01-05T08:49:39.011070 #3] INFO -- : reaped #<Process::Status: pid 9 exit 0> worker=1
2016-01-05T08:49:39.011224+00:00 app[web.1]: I, [2016-01-05T08:49:39.011178 #3] INFO -- : reaped #<Process::Status: pid 12 exit 0> worker=2
2016-01-05T08:49:39.012261+00:00 app[web.1]: I, [2016-01-05T08:49:39.012198 #3] INFO -- : master complete
2016-01-05T08:49:39.142886+00:00 app[web.1]: I, [2016-01-05T08:49:39.142802 #3] INFO -- : Refreshing Gem list
2016-01-05T08:49:39.833970+00:00 heroku[web.1]: Process exited with status 0
2016-01-05T
@dennmart
dennmart / provision.sh
Created Nov 11, 2014
Provisioning script for WaniKani to Anki (https://github.com/dennmart/wanikani-to-anki) Vagrantfile
View provision.sh
#!/usr/bin/env bash
echo "Updating apt..."
sudo apt-get update -y -qq > /dev/null
echo "Installing required libraries for the app..."
sudo apt-get -y -q install ruby-dev > /dev/null
cd /vagrant
@dennmart
dennmart / duplicate_stripe_customers.rb
Created Sep 8, 2014
Ruby script to find duplicate Stripe customers
View duplicate_stripe_customers.rb
require 'stripe'
Stripe.api_key = "YOUR_STRIPE_API_KEY"
duplicate_customers = []
last_customer_id = nil # Cursor for paginating through results
# Stripe can retrieve a maximum of 100 customers in one go, so we need to loop.
loop do
customers = Stripe::Customer.all(limit: 100, starting_after: last_customer_id)
emails = customers.data.each.map { |d| d["email"] }
View nginx
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
@dennmart
dennmart / random_emoji.rb
Last active Aug 29, 2015 — forked from hrp/emojibomb.rb
Gets a random emoji from http://www.emoji-cheat-sheet.com/ and copy it to the clipboard (Mac Only).
View random_emoji.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/"))
emoji = doc.css('.name')
IO.popen('pbcopy', 'w') { |f| f << ":#{emoji.to_a.sample.text}:" }
puts "Copied to clipboard!"
@dennmart
dennmart / wanikani_lcd.md
Last active Dec 10, 2015
Get study queue information from WaniKani API and display on 20x4 LCD screen
View wanikani_lcd.md

Parts used

  • Raspberry Pi (Model B)
  • 20x4 LCD screen (like this one)
  • 10K Potentiometer (like this one)
  • Breadboard
  • Breadboard Wires
  • Breakout header pins (0.1-inch)

Hardware wiring instructions

@dennmart
dennmart / changes.md
Created Nov 29, 2012 — forked from funny-falcon/changes.md
Performance patch for ruby-1.9.3-p327
View changes.md

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

@dennmart
dennmart / benchmark.rb
Created Jun 11, 2012 — forked from panthomakos/benchmark.rb
Benchmark Your Bundle
View benchmark.rb
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@dennmart
dennmart / .osx
Created Sep 8, 2011
Sensible defaults for Mac OS X Lion
View .osx
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Disable menu bar transparency
You can’t perform that action at this time.