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 .
@raideus
raideus / acf-auto-export.php
Created March 7, 2013 06:00
This collection of functions completely automates the "Export to PHP" feature of Advanced Custom Fields. No more manual copy + pasting! Simply specify an absolute file path (line 17) and the code will automatically write the ACF data to the file. The export is initiated whenever you publish a new field group or save changes to an existing field …
<?php
/**
* Automated PHP export for Advanced Custom Fields
*
* Export is initiated whenever an admin publishes a new field group
* or saves changes to an existing field group.
*
* Place this code in your theme's functions.php file.
*
*/
@saimonmoore
saimonmoore / export_skype_chat_history.sh
Created April 5, 2013 08:24
Bash function to export Skype chat history for a particular conversation
function export_skype_chat_history {
sqlite3 ~/Library/Application\ Support/Skype/saimonmoore/main.db "SELECT author,timestamp, body_xml FROM messages WHERE dialog_partner = '$1'" > ~/Desktop/skype_chat_history_$1.txt
}

Exporting Skype history (mac)

$ cd /tmp
# The app doesn't handle paths with spaces so we make a symlink with no space in its path
$ ln -s ~/Library/Application\ Support appsupport
$ APPDATA=/tmp/appsupport java -jar /path/to/exportskype-1.0.4.jar
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
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
@joaocunha
joaocunha / modernizr-retina-test.js
Created November 27, 2013 13:46
Modernizr test for retina / high resolution / high pixel density.
/**
* Modernizr test for retina / high resolution / high pixel density
*
* @author Joao Cunha
* @license MIT
*/
Modernizr.addTest('hires', function() {
// starts with default value for modern browsers
var dpr = window.devicePixelRatio ||
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@davidpaulsson
davidpaulsson / rwd-lazy-loading.js
Last active February 3, 2016 03:24
Lazy loading with padding-bottom hack for responsive images
/**
* Place this inline at the bottom of the html document, right before
* closing `</body>`. It's important to have this inline as we want to
* display images asap.
*
* Markup example for the actual images. It also calculates the image
* container using the [padding-top hack](https://gist.github.com/davidpaulsson/10101985),
* please do this calculation on the back end, before drawing the DOM.
* Current example can load three images sizes, customize to fit your needs. It
* also adds the calculated image URL as an data-original tag on the img element it creates,
@anotheruiguy
anotheruiguy / list-maps-libsass.md
Last active December 7, 2015 12:46
So, you want to play with List Maps

Sass 3.3 is out and you should start using Maps.

Using variables in Sass has been a core feature for years now. We have all used them to endless exhaustion and we have all seen things like this:

// establish a core color
$bravo_gray: #333;

// assign core color to semantic variable
$input-disabled-color:          $bravo_gray;
@lpirola
lpirola / nginx.conf
Last active August 29, 2015 14:04
Wordpress local development with nginx redirecting image uploads extenal server url
# Forward requests for images to another site
location ~ ^/content/uploads/(.*)\.(jpg|gif|png)$ {
rewrite ^(.*)$ http://www.example.org.br/$1 last;
}