Skip to content

Instantly share code, notes, and snippets.

@pudgereyem
pudgereyem / GIT: Commands
Last active June 15, 2018 09:15
GIT: Useful commands
# If you regret all the changes you've done (in the HEAD)
# Sort of like a huge/massive CMD-Z (undo).
git reset --hard HEAD
### ---
# If you have commited changes, and then end up regretting that,
# because you want to add new changes to that very commit.
# First add files
git add .
@pudgereyem
pudgereyem / gist:962161
Last active September 25, 2015 18:07
CSS: Reset
/* ==== Scroll down to find where to put your styles :) ==== */
/* HTML5 ✰ Boilerplate */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
@pudgereyem
pudgereyem / .htaccess
Last active December 16, 2015 04:39
Apache: .htaccess assets redirect development -> production
# Attempt to load files from production if they're not in our local version
# If you have development/production setup, it's neat to use .htaccess to redirect all failed requests to the production server (since we wont want to sync all the uploaded media between the two)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://yourlivesite.com/wp-content/uploads/$1
</IfModule>
@pudgereyem
pudgereyem / gist:8070996
Created December 21, 2013 15:43
SHELL: Viewing the Skype chat history
# Viewing the Skype chat history
# <http://superuser.com/questions/93682/viewing-the-full-skype-chat-history>
# As suggested by [daniel-beck](http://superuser.com/users/22317/daniel-beck)
# 1. Shut down Skype (Otherwise the db will be locked, I think)
# 2. Located your main.db file. It's normally stored under `/Users/username/Library/Application\ Support/Skype/yourskypeusername/main.db`
# 3. Run the following command to output the chat log, but replace "theOtherPersonsUserName".
sqlite3 main.db "SELECT author, from_dispname, datetime(timestamp, 'unixepoch') as date, body_xml FROM Messages where dialog_partner = 'theOtherPersonsUserName' ORDER BY timestamp;" > "theOtherPersonsUserName.log"
@pudgereyem
pudgereyem / advanced-custom-fields-database-setup.php
Last active January 1, 2016 12:29
PHP, WORDPRESS: Database setup for Advanced Custom Fields when having a "development" and a "production" environment.
<?php
/*
* Database setup for Advanced Custom Fields
*
* @description: Database setup for Advanced Custom Fields when having a
* "development" and a "production" environment.
* @created: 2013-12-27
*/
@pudgereyem
pudgereyem / gist:8148250
Created December 27, 2013 15:09
PHP, WORDPRESS: Register post type
<?php
/* Init post types */
add_action( 'init', 'wtf_post_resource_register' );
/*--------------------------------------------------------------------------------------
*
* wtf_post_resource_register
*
* @author Victor Meyer
@pudgereyem
pudgereyem / font-feature-settings
Created January 31, 2014 21:28
SCSS: font-feature-settings mixin
// Font feature settings mixin and property default.
// Examples: @include font-feature-settings("liga");
// @include font-feature-settings("lnum" false);
// @include font-feature-settings("pnum" 1, "kern" 0);
// @include font-feature-settings("ss01", "ss02");
@mixin font-feature-settings($settings...) {
@if length($settings) == 0 { $settings: none; }
@include experimental(font-feature-settings, $settings);
}
@pudgereyem
pudgereyem / Gruntfile.js
Created February 6, 2014 20:58
GRUNT: My Grunt Setup
/*
TO DO
1) Reduce CSS duplication
- Ideally just a single build - global.scss turns into /build/global.css
- Can Autoprefixer output minified?
- If it can, is it as good as cssmin?
- Could Sass be used again to minify instead?
- If it can, is it as good as cssmin?
@pudgereyem
pudgereyem / package.json
Created February 6, 2014 20:59
GRUNT: Packages
{
"name": "example-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.7.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-imagemin": "~0.4.0",
"grunt-contrib-watch": "~0.5.3",
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15