Skip to content

Instantly share code, notes, and snippets.

View rogeruiz's full-sized avatar

Roger Steve Ruiz rogeruiz

View GitHub Profile
@rogeruiz
rogeruiz / nav.php
Created June 4, 2011 01:59
2D Array for Simple Site Navigation
<?php
$location = array(
"home" => array(
"loc" => TRUE,
"title" => "Nine Points Collection | Portfolio of Roger Steve Ruiz",
"href" => "index.php",
"desc" => "Nine Points Co."
),
"portfolio" => array(
"loc" => TRUE,
@rogeruiz
rogeruiz / fizz_buzz.js
Created June 22, 2011 23:12
JavaScript FizzBuzz
var fizz = "Fizz",
buzz = "Buzz";
for (var i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
console.log(fizz + buzz);
} else if (i % 3 == 0) {
console.log(fizz);
} else if (i % 5 == 0) {
console.log(buzz);
} else {
@rogeruiz
rogeruiz / gist:1070949
Created July 8, 2011 01:56 — forked from gruber/gist:1063605
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description
@rogeruiz
rogeruiz / Custom.css
Created January 5, 2012 16:04
Solarized [dark] Web Inspector [Incomplete]
/*=== Elements Panel : Markup
Author: Roger Steve Ruiz
==================================================*/
/*
* The !important implementation is necessary on certain styles
* because the user-agent stylesheet & Custom.css file seem to
* be at odds when it comes to defining the Web Inspectors tools
*/
#elements-content {
/*
@rogeruiz
rogeruiz / _getPage.js
Created March 28, 2012 19:35
_getTrackingInfoPlease
_getPage: function(){
var self = this;
// let's store the current window location for later
var _currentLocation = this.url.matchPath.exec(this.url.current)[0],
_matchedLocation = ''; // need this for storage for later
// if (window.console) { console.log(FER.Config.gaq._trackPageview); }
// return void;
@rogeruiz
rogeruiz / _propertyUndefined.js
Created March 28, 2012 19:41
Map out undefined
var foo = { undefined: 5 }, bar;
foo[bar]; // 5
@rogeruiz
rogeruiz / responsibleAPILoader.js
Created March 29, 2012 21:55
Loading Facebook and Twitter API hooks responsibly
/**
* Load Twitter's API Hook Async
* Company: Rokkan (rokkan.com)
* Author: Roger Steve Ruiz (roger.ruiz@rokkan.com)
*/
Modernizr.load([{
load: '//platform.twitter.com/widgets.js',
complete: function(){
twttr.ready(function(){
// Do the JavaScripts here, dood.
@rogeruiz
rogeruiz / editorial.twig
Created March 30, 2012 19:45
Is your Content Strategy leaving things out?
{% if editorial.type_id == 2 %}
{% if editorial.content|length > editorial.summary|length %}
<p class="full-content">{{ editorial.content|raw }}</p>
{% else %}
<p class="full-content">{{ editorial.summary|raw }}</p>
{% endif %}
{% else %}
<p class="full-content">{{ editorial.summary|raw }}</p>
{% endif %}
@rogeruiz
rogeruiz / debugz.js
Created April 5, 2012 19:04
Debug Mode Activate!
switch (window.location.href.indexOf('rokkan')){
case 20:
case 22:
case 23:
window.Project.debug = true;
if (window.console) { console.warn('Debug Mode: Activated.'); }
break;
default:
window.Project.debug = false;
}
if environment == :production
on_stylesheet_saved do |file|
# pretty logging output when making a gzipp'ed file
gz_file = Pathname.new("#{file}.gz").relative_path_from(Pathname.new(project_path))
Compass::Logger.new.record(:create, gz_file)
# This generates a file of the same name but ending in .gz
`gzip -f #{file}`
end
end