Skip to content

Instantly share code, notes, and snippets.

View karbassi's full-sized avatar
🌱

Ali Karbassi karbassi

🌱
View GitHub Profile
@karbassi
karbassi / reset.css
Created March 27, 2013 17:08
Modified reset.css to include useful changes from normalize.css
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@karbassi
karbassi / updateElements.js
Created November 8, 2012 00:15 — forked from jonathantneal/updateElements.js
Update the visible-but-unfocused tab's page, styles, and scripts without ever pressing refresh.
(function (document) {
ArrayForEach = Array.prototype.forEach || function (callback, scope) { for (var i = 0, l = this.length; i < l; ++i) callback.call(scope, this[i], i, this); };
function updateElements() {
var skip = document.hidden || document.mozHidden || document.msHidden || document.oHidden || document.webkitHidden || !document.hasFocus || document.hasFocus();
ArrayForEach.call(document.querySelectorAll("html,link[rel],script[src]"), function (element) {
if (skip) {
return;
}
{
// Calculates indentation automatically when pressing enter
"auto_indent": true,
// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": [
"*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"
],
@karbassi
karbassi / README.textile
Created October 2, 2012 01:34
This example showcases how to have an 'onload' function fire off for HTML <img> elements who are already loading in the HTML DOM.

This example showcases how to have an ‘onload’ function fire off for HTML <img> elements who are already loading in the HTML DOM.

Notice that the src is set to an empty string, the onload function is set, then the src is reset.

@karbassi
karbassi / Instructions.md
Created June 25, 2012 16:57
Create a ZIP file from an SVN url

Installing

  • Download svn-zip into /usr/local/bin/. For example: curl https://raw.github.com/gist/2989864/svn-zip > /usr/local/bin/svn-zip
  • Make sure that /usr/local/bin/ is in your PATH.

Usage

In your terminal, use:

svn-zip SVN_URL ZIP_FILE_NAME

@karbassi
karbassi / screen.cheat.sheet.txt
Created April 16, 2012 20:32
Screen Cheat Sheet
.-----------------------------------------------------------------------.
| |
| Screen VT100/ANSI Terminal Emulator |
| Default Keyboard Shortcut |
| Cheat Sheet |
| |
'-----------------------------------------------------------------------'
| Peteris Krumins (peter@catonmat.net), 2007.09.21 |
| http://www.catonmat.net - good coders code, great reuse |
'-----------------------------------------------------------------------'
@karbassi
karbassi / gist:1406676
Created November 29, 2011 21:42
Base File.sublime-settings
{
"auto_indent": true,
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Monaco",
"font_size": 11,
"highlight_line": true,
"tab_size": 3,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
[2010-11-18: REVISION 1623]
[FIXED] Java bundle’s Compile & Run again works with non-ASCII source code.
[FIXED] Include latest Ruby on Rails bundle.
[FIXED] Avoid using fcntl(F_SETOWN) when Interactive Input is not present. Ticket F66289D9.
[NEW] It is possible to set DisableColumnSelectionTogglingOnOption (via defaults write) to disable ⌥ behavior. Ticket 5C202273.
@karbassi
karbassi / index.html
Created October 21, 2010 22:02
How to handle single and double click events separately in javascript.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Single and Double Click</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="the_div"></div>
<span>Double click the block</span>
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008</id>
<updated>2010-09-24T07:17:47Z</updated>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008</id>
<updated>2010-09-24T07:17:47Z</updated>
<content></content>