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

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-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
!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
curl -vvv -X PATCH --data "{\"votes\":[1]}" --header "Content-Type: application/json" "http://litepoll.com/polls/ID"
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"' {} \;
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', '1');
[
{
"name": "Hello, world!",
"script": "\"Hello, \"[^$~][,]#%\"!\"",
"input": "world",
"description": ""
},
{
"name": "Factorial",
"script": "[$1=$[\\%1\\]?~[$1-f;!*]?]f:\n10f;!.",
@schmich
schmich / release.md
Created February 6, 2016 00:04
Releasing versions
  • Bump version in source file
  • git commit --allow-empty -m "vX.Y.Z"
  • git tag --sign vX.Y.Z -m "vX.Y.Z"
  • git push &amp;&amp; git push --tags
@schmich
schmich / dev-setup.sh
Last active March 11, 2016 09:59
Multi-user git webserver deployment
sudo echo 192.168.1.42 webserver >> /etc/hosts
sudo cat >> ~/.ssh/config <<EOF
Host webserver 192.168.1.42
User user1
Hostname webserver
IdentityFile ~/.ssh/id_rsa
EOF
cat ~/.ssh/id_rsa.pub | (ssh user@webserver "mkdir -p .ssh && cat >> ~/.ssh/authorized_keys")
git init project
cd project