Skip to content

Instantly share code, notes, and snippets.

View schmich's full-sized avatar
:octocat:
May all beings be at ease

Chris Schmich schmich

:octocat:
May all beings be at ease
View GitHub Profile
[
{
"name": "Hello, world!",
"script": "\"Hello, \"[^$~][,]#%\"!\"",
"input": "world",
"description": ""
},
{
"name": "Factorial",
"script": "[$1=$[\\%1\\]?~[$1-f;!*]?]f:\n10f;!.",

Update VirtualBox add-ons: sudo /etc/init.d/vboxadd setup

Get direct public link to Google Drive file:

  • Make Google Drive folder public
  • Navigate to folder (e.g. https://drive.google.com/#folders/0B1POFdXy77b6RWR6ai1IN2hCQ00)
  • Direct link folder will be https://googledrive.com/host/{folder ID} (e.g. https://googledrive.com/host/0B1POFdXy77b6RWR6ai1IN2hCQ00)
  • Copy link to file
@schmich
schmich / install-event-machine-windows.md
Last active October 17, 2020 16:39
Install EventMachine on Windows

Installing EventMachine on Windows can fail with the following:

In file included from binder.cpp:20:0:
project.h:97:13: error: 'pid_t' has a previous declaration as 'typedef int pid_t'
In file included from project.h:151:0,
                 from binder.cpp:20:
ed.h: In member function 'void EventableDescriptor::SetSocketInvalid()':
ed.h:43:40: warning: overflow in implicit constant conversion [-Woverflow]
make: *** [binder.o] Error 1
@schmich
schmich / install-mysql2-windows.md
Last active August 29, 2015 14:06
Install mysql2 gem on Windows
set DIR=%TEMP%\mysql\mysql-connector-c-noinstall-6.0.2-winx64
mkdir %DIR%
cd %DIR%\..
curl -O -L https://copy.com/CHZ4eT4us6f1/mysql-connector-c-noinstall-6.0.2-winx64.zip?download=1
(extract zip)
gem install mysql2 -- --with-mysql-lib=%DIR%\lib --with-mysql-dir=%DIR% --with-mysql-include=%DIR%\include
for /f %d in ('where ruby ^| head -1 ^| xargs -0 dirname') do copy %DIR%\lib\libmysql.dll %d
gem install activerecord-mysql2-adapter
@schmich
schmich / git-repo-mirror.md
Created October 8, 2014 02:31
Mirroring a repo to BitBucket
  1. Create an empty repo in BitBucket
  2. git clone --bare git@github.com:user/repo.git
  3. cd repo.git
  4. git push --mirror git@bitbucket.org:user/repo.git
!Name: Halfmax
!Author: Jason Summers
!A half spacefiller found in 2005.
!www.conwaylife.com/wiki/index.php?title=Halfmax
.....O.O.................................................O.O
....O..O.................................................O..O
...OO.......................................................OO
..O...........................................................O
.OOOO.......................................................OOOO
O....O.....................................................O....O
@schmich
schmich / psiupuxa.rb
Last active February 8, 2022 14:55
Download desktop-resolution wallpapers from http://psiupuxa.com/
# Download desktop-resolution wallpapers from http://psiupuxa.com/
# into the current directory.
require 'nokogiri'
require 'open-uri'
require 'openssl'
require 'uri'
# Disable SSL verification. Ruby SSL cert bundle isn't installed on Windows by default.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
find . -type f -iname '*.php' -not -path "./vendor/*" -exec bash -c 'echo $0 && expand -t 2 -i "$0" >"$0.expand.tmp" && mv "$0.expand.tmp" "$0"' {} \;
function clickButtonAt(targetMs) {
if ($('.thebutton-container.denied').length) {
console.error('You must login first.');
return;
}
if ($('.thebutton-container.pressed').length) {
console.error('You have already pressed the button.');
return;
}