Skip to content

Instantly share code, notes, and snippets.

@toekneestuck
toekneestuck / index.js
Last active August 29, 2015 14:08
requirebin sketch
var Backbone = require('backbone');
var _ = require('lodash');
var Model = Backbone.Model.extend({
check: function() {
return _.has(this, 'myProperty');
}
});
var MyModel = Model.extend({
myProperty : true
@toekneestuck
toekneestuck / gt_social_facebook_widget.php
Created September 25, 2012 15:29
Configurable Facebook Likebox
/**
* Facebook Widget
* - Display the Facebook like box in all of it's configuration glory
*
*/
class GT_Social_Facebook extends WP_Widget {
function GT_Social_Facebook(){
$widget_ops = array( 'classname' => 'facebook-like-box', 'description' => _x('A widget for displaying a Facebook like box.', 'gt') );
/* Widget control settings. */
@toekneestuck
toekneestuck / gt_social_twitter_widget.php
Created September 25, 2012 15:20
Simple Twitter Widget for WordPress
/**
* Twitter Widget
*
*/
class GT_Social_Twitter extends WP_Widget {
function GT_Social_Twitter(){
$widget_ops = array( 'classname' => 'twitter', 'description' => _x('A widget for displaying your recent tweets.', 'gt') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'gt-twitter' );
@toekneestuck
toekneestuck / columns.less
Created September 6, 2012 14:06
Responsive, Pretty CSS Columns in LESS/SASS
/* Media Queries Assume: 1em = 16px */
/* ================================================= */
/* Helpers
/* ================================================= */
.clearfix{*zoom: 1;&:before,&:after{display:table;content:"";}&:after{clear:both;}}
.box-sizing( @boxmodel ) {
-webkit-box-sizing: @boxmodel;
@toekneestuck
toekneestuck / Rakefile
Created June 8, 2012 14:42 — forked from fstrube/Rakefile
Rake tasks for deploying a web app via rsync, and comparing local / remote file changes
CONFIG = {
## -- Rsync Deploy config -- ##
# Be sure you have setup public / private key authentication
:ssh_host => "user@hostname", # The hostname can be an alias in ~/.ssh/config
:ssh_port => nil, # Default - use ~/.ssh/config
:document_root => "/var/www", # Remote document root
:rsync_delete => true, # Whether or not to delete remote files
:deploy_default => "rsync", # Not used
:restart_apache => nil, # Remote command to restart apache
@toekneestuck
toekneestuck / underscore.nl2br
Created February 21, 2012 20:29
A port of nl2br to Underscore
_.mixin({
nl2br : function(str, is_xhtml){
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
}
});