Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕
🐺

Zach Reed bluetidepro

🍕
🐺
View GitHub Profile
@lucasfais
lucasfais / gist:1207002
Created Sep 9, 2011
Sublime Text 2 - Useful Shortcuts
View gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Victa
Victa / gist:1209370
Created Sep 11, 2011
Font sizing with REM and PX (LESS)
View gist:1209370
// ABOUT
A simple LESS (http://lesscss.org) snippet based on http://snook.ca/archives/html_and_css/font-size-with-rem
It doesn't do much but saves you typing things twice, allowing you to use rem as a unit for font-sizes
and giving a px fallback for IE
// MIXIN
.font-size(@font-size: 16){
@rem: (@font-size / 10);
font-size: @font-size * 1px;
font-size: ~"@{rem}rem";
View social_stuff.php
<?php
/*
* Plugin Name: Social Stuff
* Description: Allows users to befriend or follow one-another. Also tracks events such as commemts and follows so they they can be displayed in an activity feed.
* Version: 0.1
* Author: Stephen Coley
* Author URI: http://coley.co
* License: GPL2
*
*
@nijikokun
nijikokun / example-user.js
Created May 3, 2012
Beautiful Validation... Why have I never thought of this before?!
View example-user.js
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@ndarville
ndarville / business-models.md
Last active Nov 9, 2021
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.
View business-models.md

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
View scratchpad.js
$(function(){
// Scratchpad Intro
//--------------------------------------------------------------------------------
var intro =
['<style>',
' body {background: #DDD6B2;}',
' .container {',
' background: #fff;',
@ellerrs
ellerrs / gist:4989962
Last active Dec 13, 2015
proposed product schema
View gist:4989962
var ProductSchema = new Schema({
categoryId: String
, department: String
, ean: String
, model: String
, weight: String
, dimensions: {
height: String
, width: String
, length: String
@impressiver
impressiver / raven-config.html
Last active Oct 15, 2021
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
View raven-config.html
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
@bomberstudios
bomberstudios / sketch-plugins.md
Last active Oct 17, 2021
A list of Sketch plugins hosted at GitHub, in no particular order.
View sketch-plugins.md
@kentbrew
kentbrew / dogecoin_button.html
Last active Jan 1, 2016
dogecoin button ... wow ... such generous!
View dogecoin_button.html
<html>
<head>
<style>
a.doge {
position: relative;
display: inline-block;
height: 40px;
margin: 0 0 0 20px;
font-size: 12px;