Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ericrasch's full-sized avatar

Eric Rasch ericrasch

View GitHub Profile
@jasoncomes
jasoncomes / Readme.md
Last active June 11, 2018 17:06
Developer Project - Cars

Project Overview

So this should take them about an 30 mins to 1 hr, depending on how in depth they get. I wanted to keep the instructions as vague as possible with little direction to see how they operate. Here is a list of things we'll be looking for as we QA:

  • Questions, if they ask any
  • Github
  • Javascript/JQuery
  • HTML Markup
  • PHP Logic
  • Git Committing
# How to search the "z-index" values of your CSS project
git grep -h "z-index" | sed -E "s/.*z-index\s*:\s*(-?[0-9]+).*/\1/" | sort | uniq -c | sort -b -r
# Explanations
# git grep -h "z-index"
# -> Find every line of your project that contain "z-index"
# sed -E "s/.*z-index\s*:\s*(-?[0-9]+).*/\1/"
# -> Only keep the property value
# sort | uniq -c | sort -b -r
# -> count the number of occurrences by value
@jdsteinbach
jdsteinbach / wp-template.md
Last active August 29, 2015 14:25
WP Template Patterns: `sprint()` & `printf()`

Documentation

If you're not familiar with these PHP functions, read this documentation: printf() / sprintf().

Benefits of s/printf()

Cleaner Validation

All template code requires validation: if a variable (or array key/value) doesn't exist or doesn't contain data, we don't want to print empty HTML. Writing "pure" PHP with s/printf() for markup makes validation logic easier to see and shorter to write.

@bueckl
bueckl / wget
Last active October 11, 2023 08:05
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@jdsteinbach
jdsteinbach / betterBC.css
Last active December 9, 2015 21:28
Better BaseCamp Styles
* {
font-family: San Francisco Display, Texta, Avenir, Lucida Grande, sans-serif !important;
}
html {
background-color: #76fff7;
}
.container > .sheet {
background-color: #205D84 !important;

Setup OSX 10.9 with a Clean Install

After two years of tinkering my machine is a bit all over. With Mavericks I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

Software Update

@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
// Handles js, sass, image optimisation/compilation and does very basic PHP linting and livereload
var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
sass = require('gulp-sass'),
uglify = require('gulp-uglify'),
gutil = require('gulp-util'),
refresh = require('gulp-livereload'),
lr = require('tiny-lr'),
@lgladdy
lgladdy / grunt-sitemap.php
Created April 13, 2014 14:25
Grunt Sitemap Generator plugin for Wordpress
<?php
/**
* Plugin Name: Grunt Sitemap Generator
* Plugin URI: http://www.github.com/lgladdy
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/
@jimmynotjim
jimmynotjim / state_array.php
Last active January 3, 2016 09:59
PHP Array of US States
<?php
$state_array = array(
array(
'state_name' => 'Alabama',
'state_abbr' => 'AL'
),
array(
'state_name' => 'Alaska',
'state_abbr' => 'AK'