Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕
🐺

Zach Reed bluetidepro

🍕
🐺
View GitHub Profile
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
*
*
@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
@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;
View delete.rb
# Step 1: request and download your twitter archive
# Step 2: create a twitter app (on their dev site) so you can fill out the key and secret data
# Step 3: run, and prosper
require 'twitter'
require "json"
USERNAME = 'YOURUSERNAME'
ARCHIVE_PATH = '/YOUR/DOWNLOADS/FOLDER/data/js/tweets'
View scratchpad.js
$(function(){
// Scratchpad Intro
//--------------------------------------------------------------------------------
var intro =
['<style>',
' body {background: #DDD6B2;}',
' .container {',
' background: #fff;',
@muan
muan / details-links.md
Last active Dec 21, 2019
Details on details cheatsheet.
View details-links.md
@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 Getting-Cheat-Sheet.md

Git Cheat Sheet

Visit my blog.

Commands

Getting Started

git init

or

@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
);
@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',