Skip to content

Instantly share code, notes, and snippets.

View joacim-boive's full-sized avatar

Joacim Boive joacim-boive

View GitHub Profile
<!DOCTYPE html>
<html lang="en" class="theme theme--mercado ">
<head>
<script type="application/javascript">
!function(i, n) {
void 0 !== i.addEventListener && void 0 !== i.hidden && (n.liVisibilityChangeListener = function() {
i.hidden && (n.liHasWindowHidden = !0)
}, i.addEventListener("visibilitychange", n.liVisibilityChangeListener))
}(document, window);
</script>
@joacim-boive
joacim-boive / screen-docker-for-mac.sh
Created November 3, 2017 13:13 — forked from BretFisher/docker-for-mac.md
Screen Commands for Docker for Mac (prevent garbled text on reconnect)
# connect to tty on Docker for Mac VM
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
# disconnect that session but leave it open in background
Ctrl-a d
# list that session that's still running in background
screen -ls
# reconnect to that session (don't open a new one, that won't work and 2nd tty will give you garbled screen)
@joacim-boive
joacim-boive / git-pull-all
Created January 7, 2018 17:26 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@joacim-boive
joacim-boive / README-Template.md
Created November 3, 2017 07:12 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@joacim-boive
joacim-boive / swipe.js
Created February 25, 2016 12:20 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@joacim-boive
joacim-boive / gist:1090202
Created July 18, 2011 18:13
Indefinite swipe:ing of views using Appcelerator Titanium.
/*
The idea is to just use 2 views that can hold whatever (in my case images).
Swipe:ing left/right will move the views that is currently hidden accordingly, making it seem like it's an infinite number of views at any direction.
This should be a very memory efficient approach.
The code below requires Appcelerator Titanium: http://appcelerator.com
*/
@joacim-boive
joacim-boive / dabblet.css
Created March 20, 2013 08:22
Problems with table borders in IE7
/**
* Problems with table borders in IE7
*/
td{
padding: 3%;
border: 2px solid red;
}
@joacim-boive
joacim-boive / twt-enc.js
Created May 31, 2012 20:07
Twitter translate - Encrypt
twtTranslate.enc({"you are":"U're","it is":"its","you":"U", "todo":"2Do"," - ":"-","see":"c", "zero":"0", "one":"1", "two":"2", "three":"3", "four":"4", "five":"5", "six":"6", "seven":"7", "eight":"8", "nine":"9", "ten":"10", "for":"4", " and ":" & ", "at":"@", "great":"gr8", " how to ":" HowTo ", "JavaScript":"JS", "message":"msg", "into":"in2", "before":"b4", "star":"★","!shrug":"¯\_(ツ)_/¯"})
@joacim-boive
joacim-boive / gist:943793
Created April 27, 2011 06:08 — forked from icodeforlove/gist:868532
querySelectorAll for anything less than IE8
// IE7 support for querySelectorAll in 226 bytes... It's a little slow but better than a 20kb solution when you need something cross platform and lightweight.
(function(d){d=document,a=d.styleSheets[0]||d.createStyleSheet();d.querySelectorAll=function(e){a.addRule(e,'f:b');for(var l=d.all,b=0,c=[],f=l.length;b<f;b++)l[b].currentStyle.f&&c.push(l[b]);a.removeRule(0);return c}})()
@joacim-boive
joacim-boive / A Webshop Cart handler
Created March 29, 2011 12:37
Using XPages for Domino.
var cart = sessionScope.cart || [],
item = {};
item.unid = rowData.getColumnValue('unid');
item.price = viewScope.price;
item.title = rowData.getColumnValue('title');
cart.push(item);
sessionScope.cart = cart;