Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
@bcks
bcks / gist:6f3c16ee0cec701c10ce67b104865517
Last active January 18, 2018 13:44
Make an image of text
// a node.js method for creating images of text
// as used in https://twitter.com/nytanon and https://twitter.com/wapoanon
function makeImage(object, que, callback) {
var text = object.text;
var Canvas = require('canvas'),
Image = Canvas.Image,
canvas = new Canvas(200, 200),
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steveklabnik
steveklabnik / rails4gems.md
Last active December 19, 2015 13:19
Gems that may not be rails 4 compatible

Gems that need help with Rails 4

  • cucumber-rails
  • simple_form - has a 3.0.0.rc but it depends on rails 4.0.0.rc1
  • delayed_job_active_record - has a v4.0.0.beta3 so likely ready to release soon
  • spork-rails - has no indication of even a beta for rails 4
  • authlogic: binarylogic/authlogic#368
  • activeadmin/activeadmin#1963
@jarib
jarib / gist:5204817
Created March 20, 2013 13:54
My public key
ssh-dss AAAAB3NzaC1kc3MAAACBAJqLMUT8klGAt5VEIYAzsCNcG/8FsxBhFuCYSdvf9P5j7I84dOZsmGLHiqxcNEgrXkXMo4smJstYXSSdIVWF+RhSe4P7gH94D78mQS2dfGyXsWsJdqY7obEih76L0HCxhF8fcu4FBBCE3n1cQLfYTqAr6Crm3Rng3mTjUYQ/J8RFAAAAFQDqrN3s3nVO+2Fi6CnRw52IKpBMwQAAAIBTPpoQjYAKMMQuU0mJ/POmH4kzTeCLdyrv8v3pjJ8bOoyF6qMXqRVqlGgKmSEtmSlWD6fmnIyh34c5NiAGaJOySnkLUOLwjUvz2PkJpqazKRa1KkZblg69iKto7IpR2BID3b2gAorpJmNAtexlyn2vTrR3Ai3hCqAGy9rrnkrTEwAAAIAtwepHaG0mGPoYHzkoCNSu6Xzx3mdxFa10CxOj1BXtK5UsVysd5wWOqtYQNq4JZe9mSqk5+KRc1Q2aUAFHCgemMAP2C8RYaT+TiesFs5e+jEFG4HM6T0FDcOV6/+CVwM+IavYRC71ZkE1cM0o9Ycs79h5flNOS7unhSIlIM8OFsg== jari.bakken@gmail.com
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

anonymous
anonymous / failing_test.js
Created November 26, 2012 20:27
WebDriverJS in node
var webdriver = require('./build/javascript/node/webdriver')
var driver = new webdriver.Builder().
withCapabilities({'browserName': 'chrome'}).
build();
driver.findElement({name: 'not-there'});
/*
timers.js:103
if (!process.listeners('uncaughtException').length) throw e;
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 25, 2024 01:12
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jarib
jarib / seed.rb
Created July 1, 2012 11:50
Topic/promise example
# temporary topic example
topic = Topic.create!(
title: "Formueskatt",
description: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
)
topic.promises << Promise.where(:body => "Opprettholde formueskatten, men gjøre den mer rettferdig.", :party_id => Party.find_by_external_id("A")).first
topic.save!
VoteConnection.create!(:vote => Vote.find_by_external_id(2349), :matches => false, :topic => topic)
@jarib
jarib / Gemfile
Created May 1, 2012 15:16
Boolean attributes by tag name
source :rubygems
gem "webidl"
gem "nokogiri"
gem "activesupport"
gem "watir-webdriver", :git => "git://github.com/watir/watir-webdriver"
@jarib
jarib / file.rb
Created August 15, 2011 18:08
watir-webdriver bug report template
require 'rubygems'
require 'watir-webdriver'
path = File.expand_path("test.html")
File.open(path, "w") { |io| io << DATA.read }
browser = Watir::Browser.new :firefox # replace :firefox with the browser you're having trouble with
begin
browser.goto "file://#{path}"