Skip to content

Instantly share code, notes, and snippets.

View indirect's full-sized avatar

André Arko indirect

View GitHub Profile
@indirect
indirect / .ruby-version
Last active February 25, 2023 23:01 — forked from koffeinfrei/.ruby-version
Performance comparison of different ruby serializer methods
3.2.1
@indirect
indirect / kiosk.md
Last active October 30, 2021 00:29 — forked from anthonyray/kiosk.md
Turn your Raspberry Pi into a kiosk playing looping videos

An acquaintance needed a video kiosk that plays looping videos for an exposition booth. Since I have a bunch of Raspberry Pis lying around, I figured that it would be the perfect use case for using one of them.

Let's assume we start from scratch, with a unflashed, brand new SD card and your Raspberry Pi.

Installing the OS

Install a version of Raspbian that includes the desktop. You can head over to : https://www.raspberrypi.org/downloads/raspbian/ and follow the instructions.

Once the image is downloaded, you can burn it to your SD card with tools like Etcher (https://www.balena.io/etcher/)

@indirect
indirect / Gemfile
Created February 12, 2010 08:11 — forked from samgranieri/Gemfile
rails 2.3.5 configuration for bundler 0.9.5
# include at least one source and the rails gem
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
gem 'sqlite3-ruby', :require => 'sqlite3'
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3
# gem 'devise', :git => 'git://github.com/plataformatec/devise.git', :ref => 'v1.0'
group :development do
# bundler requires these gems in development
@indirect
indirect / user-repos-default-branch.sh
Created June 27, 2020 07:21
Update the default branch name for every repo in a user/org
#!/bin/bash
NAME="$1"
BRANCH="${2:-main}"
HUB=$(which hub || echo /usr/local/bin/hub)
# get repos that belong to the given user/org, are not archived, and are not forks
repos=($($HUB api --paginate --obey-ratelimit --flat graphql -f query='
query($endCursor: String) {
repositoryOwner(login: "'"$NAME"'") {
repositories(isLocked: false, isFork: false, first: 100, after: $endCursor) {
@indirect
indirect / gist:c4c9f7fd34b08a8804e5
Created July 31, 2014 03:43
Get list of all gem names from Rubygems
$ gem list --verbose -r
*** REMOTE GEMS ***
GET https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
^CERROR: Interrupted
@indirect
indirect / DefaultKeyBinding.dict
Last active February 7, 2020 04:55
Type many useful symbols like ↑, ⌘, and ★
/* Put this in ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* Based on a file from @eventualbuddha */
{
/* Modifier keys: start with C-m */
"^m" = {
"^ " = ("insertText:", "\U2423"); /* C-space space */
"^e" = ("insertText:", "\U21A9"); /* C-e return */
"e" = ("insertText:", "\U2305"); /* e enter */
@indirect
indirect / proposal.md
Last active August 9, 2019 21:44 — forked from sidk/proposal.md

How would you summarize your proposal, in one sentence?

A web application that collects usage information from RubyGems.org, and surfaces that information in charts and graphs for use by the Ruby community—the initial version includes Ruby, Bundler, and RubyGems versions, as well as Ruby platform and CI platform.

Who are you, and how are you related to the project?

Sid Krishnan, a contributor to the project for the last few months, collaborating with André Arko, the original creator.

@indirect
indirect / child.rb
Created June 14, 2013 18:46
ruby child process with non-buffered output
# give the child process a terminal so output isn't buffered
@master, slave = PTY.open
in_clean_environment do
@pid = ::Process.spawn(
config.env,
%Q(bash -c "#{config.command}"),
:in => slave,
:out => slave,
:err => slave,
:chdir => config.dir,
@indirect
indirect / tmux-named
Created April 25, 2013 17:43
Open multiple tmux sessions connected to the same set of windows
#!/bin/bash
# We need tmux. Obvs.
if [[ -z `which tmux` ]]; then echo "You need tmux first!"; exit 1; fi
# Named variables are much more flexible
name="$1"
# Make sure we got a session name to create or join
[[ -n "$name" ]] || { echo "Usage: tmux-named [SESSION_NAME]"; exit; }
@indirect
indirect / SearchProviders.plist
Created July 23, 2011 16:06
SafariOmnibar search keywords
<key>SafariOmnibar_SearchProviders</key>
<array>
<dict>
<key>Name</key>
<string>Google</string>
<key>Keyword</key>
<string>g</string>
<key>Default</key>
<true/>
<key>SearchURLTemplate</key>