Skip to content

Instantly share code, notes, and snippets.

View gcpantazis's full-sized avatar

George Pantazis gcpantazis

View GitHub Profile
@gcpantazis
gcpantazis / gist:3077894
Created July 9, 2012 17:55
Compass - Subjectively Better Sprite Mixin
$icons: sprite-map("icons/*.png");
$icons-background: sprite-url($icons) no-repeat transparent;
@mixin icons-image-replacement($sprite) {
background: $icons-background;
background-position: sprite-position($icons, $sprite);
border: 0;
color: transparent;
display: block;
@gcpantazis
gcpantazis / gist:3254584
Created August 4, 2012 04:42
Making 3D shapes using CSS Transforms
var CupView = Backbone.View.extend({
'events': {},
'settings': {
'shardCount': 10,
'columnWidth': 300,
'columnHeight': 500
},
@gcpantazis
gcpantazis / gist:3867218
Created October 10, 2012 18:02
Reduced loader example.
<script type="text/template" id="template_loader">
<div class="loader <%= className %>">
<% for ( var i = 0; i <= 11; i++ ) { %>
<div class="bar<%= i %>"></div>
<% } %>
</div>
</script>
@gcpantazis
gcpantazis / gist:3907345
Created October 17, 2012 18:49
Bash Profile
# Colors
BLACK="\[\e[0;30m\]"
BLUE="\[\e[1;34m\]"
GREEN="\[\e[0;32m\]"
LIME="\[\e[1;32m\]"
CYAN="\[\e[0;36m\]"
ORANGE="\[\e[1;31m\]"
RED="\[\e[0;31m\]"
PURPLE="\[\e[0;35m\]"
BROWN="\[\e[0;33m\]"
@gcpantazis
gcpantazis / gist:3940352
Created October 23, 2012 17:56
Creating and Destroying Iframes, Qunit Tests.
// Create an <iframe>, return the DOM object
// back to the caller once loaded.
var iframeLoad = function(pageURL, cb){
var iframe = document.createElement('iframe');
iframe.onload = function(event) {
// Return iframe to callback.
@gcpantazis
gcpantazis / gist:3940361
Created October 23, 2012 17:57
QUnit Module, Showing Iframe Loading / Destruction Calls.
// Tests : Example
var i, // testing iframe.
w; // testing iframe's window object.
module("Backbone Routers", {
setup: function() {
// Async, hold tests until iframe loads.
@gcpantazis
gcpantazis / gist:3940373
Created October 23, 2012 18:01
Example of In-App Init Prevention.
// In your actual app's JS, do not initialize if site is iframed.
require(['app-global'], function(AppGlobal) {
if ( top !== self ) {
return;
}
// Otherwise
@gcpantazis
gcpantazis / gist:3955842
Created October 25, 2012 22:22
Git exports and reference
# Export all the files changed since commit COMMIT-ID-OR-ALIAS
tar czvf changed-files.tar.gz -T <(git diff --name-only COMMIT-ID-OR-ALIAS..)
@gcpantazis
gcpantazis / gist:4254458
Last active October 13, 2015 20:48
Setup Procedure for new Dev Machines
{
"theme": "Soda Dark.sublime-theme",
"draw_white_space": "all",
"rulers": [75, 100],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"tab_size": 2
}