Skip to content

Instantly share code, notes, and snippets.

View rendfall's full-sized avatar
💭
Coffee is a drink, not a language! ☕️

rendfall rendfall

💭
Coffee is a drink, not a language! ☕️
View GitHub Profile
@rendfall
rendfall / wp-getpostswithmeta.php
Created March 7, 2015 18:00
[WordPress] Get Posts with meta
function getPostsWithMeta() {
global $wpdb;
$query = "
SELECT DISTINCT
ID,
post_title,
post_date,
guid
FROM wp_posts
@rendfall
rendfall / repair-indent
Created March 10, 2015 10:42
SublimeText3 - Repair bad indentation
// required plugin: https://github.com/jisaacks/ChainOfCommand
// Preferences > Key Bindings - User
[
{ "keys": ["alt+shift+r"],
"command": "chain",
"args": {
"commands": [
["unindent", {
"context": [
@rendfall
rendfall / disable-close-window-hotkey
Created March 10, 2015 10:43
Disable close_window hotkey
// Preferences > Key Bindings - User
{ "keys": ["ctrl+shift+w"], "command": "noop"}
@rendfall
rendfall / getpreloader
Created April 13, 2015 09:03
Preloader helper
var getPreloader = function(dest, options){
options = $.extend({
alt: '',
css: {
display: 'block',
margin: '30px auto'
},
src: '/assets/ajax_loaders/loader-big.gif'
}, options);
@rendfall
rendfall / ES5 polyfills
Created June 24, 2015 21:12
List of basic ECMA262-5 methods [http://stackoverflow.com/a/2790686]
// copied from http://stackoverflow.com/a/2790686
'use strict';
// Add ECMA262-5 method binding if not supported natively
//
if (!('bind' in Function.prototype)) {
Function.prototype.bind= function(owner) {
var that= this;
if (arguments.length<=1) {
@rendfall
rendfall / autoclick.js
Created September 9, 2015 09:29
[YouTube] Create playlist using `watch later` button
// Warning: if you want add 300+ files your chrome will probably crash.
var a=document.querySelectorAll('.yt-uix-button');for(var i=0,l=a.length;i<l;i++){a[i].click()};
@rendfall
rendfall / aliases
Last active November 23, 2016 12:35
Cmder - Aliases
.. = cd ..
pro = cd /projects
ll=ls -Xal --color
ip = ipconfig | grep "IPv4"
build = npm run build
bb = npm run build
n = npm $*
@rendfall
rendfall / bash-shell-autorun
Created September 30, 2015 20:48
Bash shell on startup
sudo chsh -s /bin/bash username
@rendfall
rendfall / Object.watch
Created November 5, 2015 09:06
Object.watch by Eli Grey’s
// object.watch by Eli Grey: https://gist.github.com/eligrey/175649
if (!Object.prototype.watch)
{
Object.prototype.watch = function (prop, handler)
{
var val = this[prop],
getter = function ()
{
return val;
},
@rendfall
rendfall / git-undo-custom-commit.sh
Created May 24, 2016 10:10
[GIT] Undo custom bad commit
git checkout <bad-commit>
# ... make your changes ...
git commit --amend -v
git rebase --onto HEAD <bad-commit> <checked-out-branch>