Skip to content

Instantly share code, notes, and snippets.

View zacwasielewski's full-sized avatar

Zac Wasielewski zacwasielewski

View GitHub Profile
@gcoop
gcoop / cleanse.php
Created November 16, 2010 13:13
Simple cleanse function to remove special chars from a string (amongst other things) in PHP
<?php
function cleanse($string, $allowedTags = array())
{
if (get_magic_quotes_gpc()) {
$string = stripslashes($stringIn);
}
// $string = kses($string, $allowedTags); // For kses {@see http://sourceforge.net/projects/kses/}
// ============
@nicoleslaw
nicoleslaw / 1_Tiny_Content_Framework.md
Last active June 14, 2024 17:42
Tiny Content Framework

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email (nicole@nicolefenton.com).

Contents

@etienned
etienned / csstidy
Created May 25, 2012 18:28
CLI for the PHP version of CSSTidy
#!/usr/bin/env php
<?php
/**
* CSSTidy - Command Line Interface (CLI)
*
* Command Line Interface that try to mimic as much as possible the C++ CLI
* version of csstidy. It should be a drop in replacment for the C++ CLI that is
* no longuer maintain. New settings like css_level are added.
*
* Copyright 2005, 2006, 2007 Florian Schmitz
@lukecanvin
lukecanvin / backbone.localCache.js
Created July 20, 2012 08:56
Online/offline syncing for Backbone
Backbone.serverSync = Backbone.sync;
Backbone.pingUrl = '/Ping';
Backbone.localID = function() {
var localID = (localStorage.localID ? parseInt(localStorage.localID) : 0);
localID++;
localStorage.localID = localID.toString()
return -localID;
}
@aras-p
aras-p / preprocessor_fun.h
Last active June 12, 2024 00:35
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@bhubbard
bhubbard / reset-idxbroker-widgets.css
Last active August 11, 2021 10:57
A starting css template for IDX Broker
/* -------------------------------------------------------- */
/* IDX BROKER WIDGET RESETS */
/* -------------------------------------------------------- */
/* SHOWCASE WIDGET
----------------------------------------------------------- */
.IDX-showcaseTable {
max-width: 100% !important;
}
.IDX-showcaseCell {
@madalinignisca
madalinignisca / gravityforms.css
Last active November 14, 2019 02:30
Gravity forms default styles and built in classes that can be used when creating forms with this plugin Maintained from http://www.gravityhelp.com/documentation/page/Design_and_Layout Use it to style Gravity Forms like a boss :)
/****************************************************************************
*** Gravity styles ***
****************************************************************************/
/*Form Body
contains the main form content*/
body .gform_wrapper .gform_body {border: 1px solid red}
/*Form List Container
unordered list used to structure all of the form elements*/
@nikolov-tmw
nikolov-tmw / multiple-roles-per-user.php
Last active October 5, 2021 03:56
Multiple roles per user WordPress plugin.
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
00622,17.991245, -67.153993
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end