Skip to content

Instantly share code, notes, and snippets.

View starzonmyarmz's full-sized avatar

Daniel Marino starzonmyarmz

View GitHub Profile
@starzonmyarmz
starzonmyarmz / hide-inline-images.js
Created January 20, 2012 19:14
A userscript for Flowdock that adds a button next to inline elements like Tweets and Images that allows you to hide them. Really useful to hide annoying animated gifs and hubot pug bombs
(function () {
setInterval(function(){
$('.image-preview-wrapper').not('.hideBtnAdded').each(function() {
var t = $(this);
if (t.find('.hideImg').length === 0) {
t.append('<button class="hideImg">Hide This Image</button>');
t.addClass('hideBtnAdded');
}
});
$('#chat_app_input').keypress(function(e) {
if (e.keyCode === 13) {
console.log('enter pressed');
}
return false;
});
@starzonmyarmz
starzonmyarmz / css_and_js_experiments_2.html
Created December 23, 2011 02:49
fooling around with css and js some more
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>untitled</title>
<style>
@starzonmyarmz
starzonmyarmz / css_and_js_experiments.html
Created December 22, 2011 21:48
fooling around with css and javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>untitled</title>
<style>
// Views
var SchoolsView = Backbone.View.extend({
el: $('#ridley_schools table'),
collection: new SchoolList(),
matchingSchools: $('#school_row_template').html(),
initialize: function(){
_.bindAll(this, 'render'); // to solve the this issue
this.collection.bind('reset', this.render);
@starzonmyarmz
starzonmyarmz / bullets_over_list_items.html
Created December 1, 2011 17:38
A solution for getting list bullets above the item - in response to http://dribbble.com/shots/337837-CSS-to-the-Rescue
<!doctype html>
<head>
<style>
body {
margin: 50px;
}
ol {
// Countdown Clock
function countdown(action) {
function countItDown() {
var cd = $('#countdown');
if (cd.val() > 0) {
cd.val(cd.val() - 1);
setTimeout(countItDown, 1000);
} else {
clearTimeout();
@starzonmyarmz
starzonmyarmz / iOS_test.js
Created August 19, 2011 17:36
Test for iOS devices
/* Test for iOS device, and insert class on body tag. You can't upload files
* on iOS devices, but you can on Android devices, so using mobile style sheets
* won't work for showing and hiding certain content during the sign up process. */
(function isIOS() {
if (/iPhone|iPod|iPad/i.test(navigator.userAgent)) {
$('html').addClass("ios");
} else {
$('html').addClass("no-ios");
}
})();
@starzonmyarmz
starzonmyarmz / js_dom.html
Created June 24, 2011 20:34 — forked from smith/js_dom.html
Get DOM Structure from BODY to clicked element
<!doctype html>
<html lang="en">
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
@starzonmyarmz
starzonmyarmz / redmine_dotjs_script.js
Created April 11, 2011 14:04
Hacks/Mods to be applied to an installation of redmine using dotjs. Rename this file to your installation's url following dotjs's naming convention.
/*
* I hate how the Issue Subject field has autocomplete turned on,
* but others at my place of employment don't share the same sentiments
* so this script will turn off autocomplete locally without modifying
* the code base.
*/
(function noAutoComplete() {
document.getElementById("issue_subject").setAttribute("autocomplete", "off");
})(