Skip to content

Instantly share code, notes, and snippets.

View SlugService.php
<?php
class SlugService
{
public function slugify($string)
{
$sep = '-';
// Replace special chars with hyphen
@zakdances
zakdances / Contract Killer 3.md
Created May 5, 2017 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@zakdances
zakdances / Bootstrap-Lite
Last active Aug 29, 2015
An extremely light-weight version of Bootstrap that can be copy-pasted into projects to eliminate a dependency.
View Bootstrap-Lite
$font-size-base: 14px !default;
$line-height-base: 1.428571429 !default; // 20/14
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
//** Background color for `<body>`.
$body-bg: #fff !default;
View Grunt Cheatsheet
in .bash_profile:
# Install a grunt plugin and save to devDependencies
function gi() {
npm install --save-dev grunt-"$@"
}
# Install a grunt-contrib plugin and save to devDependencies
function gic() {
npm install --save-dev grunt-contrib-"$@"
@zakdances
zakdances / js2coffee Cheatsheet
Last active Jan 1, 2016
js2coffee cheatsheet
View js2coffee Cheatsheet
js2coffee file.js > file.coffee -V -it -sq
# The help banner that is printed when `js2coffee` is called without arguments.
BANNER = """
Usage: js2coffee [options] path/to/script.js
js2coffee file.js
js2coffee file.js > output.coffee
cat file.js | js2coffee
View CocoaHTTPServer podspec
Pod::Spec.new do |s|
s.name = 'CocoaHTTPServer'
s.version = '2.4'
s.license = 'BSD'
s.summary = 'A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications.'
s.homepage = 'https://github.com/robbiehanson/CocoaHTTPServer'
s.authors = { 'Robbie Hanson' => 'cocoahttpserver@googlegroups.com' }
s.source = { :git => 'https://github.com/zakdances/CocoaHTTPServer.git', :tag => "#{s.version}" }
s.source_files = '{Core,Extensions}/**/*.{h,m}'
s.requires_arc = true
View Cocoapods Cheat Sheet
pod spec create Peanut
edit Peanut.podspec
pod spec lint Peanut.podspec
View ReactiveCocoaIO.podspec
Pod::Spec.new do |s|
s.name = "ReactiveCocoaIO"
s.version = "0.0.1"
s.summary = "Reactive file management framework built on top of ReactiveCocoa."
s.homepage = "https://github.com/ReactiveCocoa/ReactiveCocoaIO"
s.author = { "ReactiveCocoa" => "ReactiveCocoa" }
s.source = { :git => "https://github.com/zakdances/ReactiveCocoaIO.git", :commit => "7088c256fa55afe98dd60c880fa755fb4dc8265b" }
s.license = 'Simplified BSD License'
s.description = "ReactiveCocoaIO is a framework for accessing and manipulating a file system through signals, based on ReactiveCocoa."
View ReactiveCocoaLayout.podspec
Pod::Spec.new do |s|
s.name = "ReactiveCocoaLayout"
s.version = "0.4"
s.summary = "Reactive layout framework built on top of ReactiveCocoa."
s.homepage = "https://github.com/ReactiveCocoa/ReactiveCocoaLayout"
s.author = { "ReactiveCocoa" => "ReactiveCocoa" }
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoaLayout.git", :commit => "c3da93e6cae28649ff03b344895cb9a4d9e78ccb" }
s.license = 'Simplified BSD License'
s.description = "ReactiveCocoaLayout is a framework for describing Cocoa and Cocoa Touch layouts in a reactive way, based on ReactiveCocoa."
@zakdances
zakdances / Git Cheatsheet
Last active Apr 28, 2016
Git cheatsheet
View Git Cheatsheet
// Create new branch 👉 track new branch 👉 switch to new branch
git checkout -b <branch> --track
git update-index --assume-unchanged <file>
git remote -v
git remote add upstream -f https://github.com/otheruser/repo.git
git remote set-url origin git://new.url.here