Skip to content

Instantly share code, notes, and snippets.

const axios = require("axios").default;
const CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const PHONE = process.argv[2];
const DOMAIN = 'xxxxxx.us.auth0.com';
const options = {
method: 'POST',
url: `https://${DOMAIN}/passwordless/start`,
{
"name": "bundle-all",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@abiral
abiral / developer.php
Last active January 9, 2017 09:05
A developer file that resolves the broken images coming from post thumbnail, and redux framework. Besides that, it will also provide some functions that will log or print the output only if wp debug is set to true
<?php
add_filter( 'wp_get_attachment_image_src', 'fillup_broken_image_src',10,2);
function fillup_broken_image_src($image, $attachment_id){
$path = get_attached_file($attachment_id);
if(!file_exists($path)){
$w = isset($image[1])?$image[1]:1348;
$h = isset($image[2])?$image[2]:600;
$image[0] = 'http://placehold.it/'.$w.'x'.$h;
}
@abiral
abiral / gist:a7c3209436fde33ed649
Created January 8, 2016 15:58 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@abiral
abiral / loop-multisite.sh
Created December 16, 2015 12:17 — forked from rorymcdaniel/loop-multisite.sh
Bash script that will regenerate all images for all sites in a WordPress multisite network
#!/bin/bash
for site in `wp site list --field=url`; do
wp media regenerate --yes --url=$site
done
~