Skip to content

Instantly share code, notes, and snippets.

@mrsweaters
mrsweaters / pause_and_resume.md
Created August 22, 2012 23:36
Joyride 2 Pause and Resume Example

The below configuration will pause the tour after tooltip 2 has appeared (index of 1). In the postStepCallback we check to see if the tour has been paused and fire some code.

<script>
  $(window).load(function() {
    $('#joyRideTipContent').joyride({
      pauseAfter : [1],
      postStepCallback : function (index, tip) {
        if ($(this).joyride('paused')) {
 console.log('Hey there, you\'ve paused the tour.');
@mrsweaters
mrsweaters / jquery_backwards.js
Created August 23, 2012 16:00
Backwards compatability
jquery_check : function () {
// define on() and off() for older jQuery
if (!$.isFunction($.fn.on)) {
$.fn.on = function(types, sel, fn) {
return this.delegate(sel, types, fn);
};
@mrsweaters
mrsweaters / snoopy.txt
Created September 10, 2012 21:00
snoopy
.o.
| | _ ,
.', L.-'` `\ ||
__\___,|__--,__`_|__
| % `=` |
| ___%_______________|
| ` |
| -------------------|
|____________________|
|~~~~~~~~~~~~~~~~|
@mrsweaters
mrsweaters / bullets.html
Created September 14, 2012 16:33
Orbit Custom Bullets
<ul class="orbit-bullets">
<li class="has-thumb active" style="background-image: url(/path/to/bullets/bullet-one.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">1</li>
<li class="has-thumb" style="background-image: url(/path/to/bullets/bullet-two.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">2</li>
<li class="has-thumb" style="background-image: url(/path/to/bullets/bullet-three.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">3</li>
</ul>
@mrsweaters
mrsweaters / start_on_click.js
Created October 1, 2012 20:14
start tour on click instead of onLoad
$('#startTour').on('click', function (e) {
e.preventDefault();
$('#contentUL').joyride();
});
@mrsweaters
mrsweaters / 1.png
Created October 29, 2012 17:42 — forked from jeffkreeftmeijer/1.png
Simple image diff
1.png
require 'nfc'
tags = {
"04823691212580" => "Fitter, happier, more productive",
"04673391212580" => "comfortable",
"04C33091212580" => "not drinking too much",
"04C92C91212580" => "regular exercise at the gym",
"04F15D91212580" => "three days a week",
"041C9F91212581" => "getting on better with your associate employee contemporaries",
"04D79A91212580" => "at ease",
@mrsweaters
mrsweaters / update_encoding.rb
Created April 16, 2013 17:41
Convert from latin1 to utf8 Charater Set
class UpdateEncoding < ActiveRecord::Migration
def self.up
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database]
execute 'ALTER DATABASE ' + database_name + ' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE categories CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE categories_posts CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE comments CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE posts CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE uploads CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
execute 'ALTER TABLE last_tweet_ids CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
@mrsweaters
mrsweaters / abide-example-blog.html
Last active June 14, 2019 15:08
An example implementation of Foundation Abide.
<form data-abide>
<div class="name-field">
<label>Your name <small>required</small></label>
<input type="number" required pattern="[a-zA-Z]+">
<small class="error">Name is required and must be a string.</small>
</div>
<div class="email-field">
<label>Email <small>required</small></label>
<input type="text" required pattern="email">
<small class="error">An email address is required.</small>

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname