Skip to content

Instantly share code, notes, and snippets.

View mindbreaker's full-sized avatar

Tom mindbreaker

View GitHub Profile
@mindbreaker
mindbreaker / backbone.js
Created May 27, 2011 09:52
Backbone-example
$(document).ready ->
class AppView extends Backbone.View
events:
"keypress #new-todo": "createOnEnter"
createOnEnter: (event) ->
return if event.keyCode != 13
Todos.create content: @input.val()
$('#new-todo').val ''
@mindbreaker
mindbreaker / ruby-with-rbenv.sh
Last active December 16, 2015 17:41
Installing Ruby 2.0.0-rc2 using Rbenv and prevent the Error "The Ruby openssl extension was not compiled. Missing the OpenSSL lib?"
# Before run the command rbenv install 2.0.0-rc make sure to run:
sudo apt-get install openssl-dev
#after that, p0 for ruby debug
rbenv install 2.0.0-p0
@mindbreaker
mindbreaker / install.sh
Created January 28, 2014 15:52
Install ProtoShare Wallet on Ubuntu
sudo apt-get install libdb++-dev
git clone git://github.com/InvictusInnovations/ProtoShares.git
cd ProtoShares/
qmake-qt4 -makefile protoshares-qt.pro
make
@mindbreaker
mindbreaker / scootercites.js
Last active March 21, 2016 13:56
scooter-cites
var scooterCites = [{
'lyric': "How much is the fish?",
'song': "How much is the fish"
}, {
'lyric': "I am the horseman!",
'song': "One – Always hardcore"
}, {
'lyric': "Döb döb döb da da döb döb döb!",
@mindbreaker
mindbreaker / ga.js
Created June 10, 2016 12:52
Google Analytics Absprungrate senken
ga('create', 'UA-XXXX-XX', 'auto');
ga('send', 'pageview');
setTimeout("ga('send','event','Über 20 Sekunden','Besuchszeit länger als 20 Sekunden')",20000); // Länger als 20 Sekunden auf einer Seite
@mindbreaker
mindbreaker / headline-tester.js
Last active May 10, 2017 08:50
H1 - H6 Headline Tester
$("h1,h2,h3,h4,h5,h6").each(function() {
console.log(Array(parseInt($(this).prop("localName").substring(1,2))*2).join("-") + " " + $(this).prop("localName") + " " + $(this).text().trim());
})
@mindbreaker
mindbreaker / gtm.js
Created July 18, 2017 13:51
Google Tag Manager externes JavaScript File
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');
@mindbreaker
mindbreaker / onpage-copy-urls-bookmarklet.js
Last active July 20, 2017 12:18
Copy URLs from Ryte.com (formerly OnPage.org)
javascript:void function(){$("table").prepend("<textarea id='copyurls' cols='100' rows='20' style='height:auto; max-width: none'></textarea>"),$("table tbody tr").each(function(){$("textarea#copyurls").append($(this).data("url")+"\n")})}();
@mindbreaker
mindbreaker / file-extension.js
Last active July 26, 2017 10:03
Google Tag Manager Variablen fürs Download-Tracking: Dateiname (katalog.pdf) und Dateierweiterung (pdf)
function() {
return {{Click URL}}.split('.').pop();
}