Skip to content

Instantly share code, notes, and snippets.

View r17x's full-sized avatar
🤘
REconciling...

RiN r17x

🤘
REconciling...
View GitHub Profile
@r17x
r17x / index.html
Created May 15, 2018 12:16 — forked from sconstantinides/index.html
React PWA example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- The usual suspects -->
<meta charset="utf-8">
<meta name="description"
content="My app is awesome because...">
<title>My awesome app</title>
<link rel="shortcut icon"
@r17x
r17x / customtaxonomydropdown.php
Created April 10, 2018 09:14 — forked from hameedullah/customtaxonomydropdown.php
Custom Taxonomy drop downs for parents and child
<?php
/*
Plugin Name: Custom Taxonomy DropDown
Author: Hameedullah Khan
Aurhot URI: http://hameedullah.com
*/
// change this to your taxonomy
$brand_taxonomy = 'category';
@r17x
r17x / rabbitmq.txt
Created March 22, 2018 05:55 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@r17x
r17x / unregister.js
Created February 28, 2018 11:36 — forked from inian/unregister.js
Unregister all SW registrations
try {
navigator.serviceWorker.getRegistrations().then(function(registrations) {
registrations.forEach(function(registration) {
console.log('removing registration', registration);
registration.unregister();
})
})
}
catch (e) {
console.log('failed to unregister all service workers', e);
@r17x
r17x / gist:2401a3149dd04e1d10beab720c49b353
Created February 21, 2018 03:48 — forked from hissy/gist:7352933
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@r17x
r17x / wp-featured-image-upload-for-front-end.php
Created February 21, 2018 03:48 — forked from juyal-ahmed/wp-featured-image-upload-for-front-end.php
Upload featured image on custom post from WordPress front-end
@r17x
r17x / zsh.md
Created February 21, 2018 01:05 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@r17x
r17x / submodule-git.md
Last active September 14, 2018 04:34 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@r17x
r17x / md5_hash_decrypt.py
Created January 30, 2018 09:41 — forked from miodeqqq/md5_hash_decrypt.py
Python MD5 decrypt.
# -*- coding: utf-8 -*-
import hashlib
import sys
import time
# Using: ./hash.py hashcode
# For example: ./hash.py 9743a66f914cc249efca164485a19c5c
def timing(f):