Skip to content

Instantly share code, notes, and snippets.

@caspian311
caspian311 / install_nokogiri.sh
Created March 29, 2017 13:08
Installing Nokogiri on MacOS
gem install nokogiri -- \
--use-system-libraries \
--with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
@caspian311
caspian311 / Hide Passage Resources
Created March 10, 2017 01:27
BibleGateway Bookmarlet - copy and paste this into the 'url' for a bookmark and it will remove the noise around the text
javascript: (function() { $('.passage-resources').hide(); $('.search-section').hide(); $('header').hide(); $('.sys-announce').hide(); $('footer').hide(); $('.sidebar-main').hide(); $('.passage').css({margin: 0}); $('.passage-resources-link.open-link').hide(); $('.passage-main-wrap').css('margin-left', '0'); })()
@caspian311
caspian311 / phonix_elixir_startup.md
Created December 7, 2016 23:25
How to get around all the errors when getting a phoenix app up and running

Install pre-requisites

brew install elixir
# maybe others, I don't remember

Install web framework

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Create app

Create rails app:

$ rails new <project-name> -T -d mysql

Add to Gemfile:

gem “rspec”
gem "haml-rails"

Install packages:

gem install nokogiri -v '1.6.7.2' -- \
--with-xslt-dir=/usr/local/opt/libxslt \
--with-zlib-dir=/usr/local/opt/zlib \
--with-xml2-dir=/usr/local/opt/libxml2
@caspian311
caspian311 / spin_page.js
Last active November 30, 2015 22:47
Doing barrel rolls on any page
(function() {
var rotationInDegrees = 0;
function rotateThePodPleaseHal() {
rotationInDegrees += 5;
document.getElementsByTagName('body')[0].style.transform = 'rotate3d(1, 0, 1, ' + rotationInDegrees + 'deg)';
if (rotationInDegrees < 360) {
setTimeout(rotateThePodPleaseHal, 10);
}
}
@caspian311
caspian311 / setup_karma.sh
Last active November 20, 2015 12:57
How to setup a front-end test environment with Karma
# create project space
mkdir -p <path-to-project>
cd <path-to-project>
# initialize your environment
git init
npm init
bower init
# install app dependencies
@caspian311
caspian311 / NUnit_TestFixture_template
Last active August 29, 2015 14:26
Resharper NUnit templates
$HEADER$namespace $NAMESPACE$
{
[NUnit.Framework.TestFixture]
public class $CLASS$
{
private $TestObjectType$ _testObject;
[NUnit.Framework.SetUp]
public void SetUp()
{
@caspian311
caspian311 / jenkins_console.groovy
Last active August 29, 2015 14:20
Jenkins script console to find out where a slave lives
println InetAddress.localHost.canonicalHostName
@caspian311
caspian311 / .inputrc
Created December 12, 2014 20:51
Fix for terminal ctrl arrows
# goes into ~/.inputrc or /etc/inputrc
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word