Skip to content

Instantly share code, notes, and snippets.

View verticalgrain's full-sized avatar

Jamie Graham verticalgrain

View GitHub Profile
@aikusuma
aikusuma / wordpress-json-cheatsheet.md
Created June 27, 2018 20:35 — forked from verticalgrain/wordpress-json-cheatsheet.md
Wordpress JSON API Cheat Sheet

Get posts from one category:

http://www.mixmeals.com/wp-json/wp/v2/categories/1

Get posts from one category by slug:

http://www.mixmeals.com/wp-json/wp/v2/categories?slug=lunch

Get posts from multiple categories by slug or id:

@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@damiencarbery
damiencarbery / cmb2-repeater-demo-display-data.php
Last active September 9, 2023 02:53
CMB2 Repeater Demo - a simple example
<?php
add_filter( 'the_content', 'crd_append_post_links' );
function crd_append_post_links( $content ) {
if ( is_page() ) {
$post_links_data = get_post_meta( get_the_ID() );
if ( isset( $post_links_data[ 'blog_group' ][ 0 ] ) ) {
$blog_list = maybe_unserialize( $post_links_data[ 'blog_group' ][ 0 ] );
$posts_list = '<ul>';
foreach ( $blog_list as $post_info ) {
@tkh44
tkh44 / Animation.jsx
Last active September 13, 2022 01:31
react-router v4 animated with data-driven-motion
import React from 'react'
import { BrowserRouter as Router, Route, Link, Redirect, matchPath } from 'react-router-dom'
import { Motion } from 'data-driven-motion' // https://github.com/tkh44/data-driven-motion
const WOBBLY_SPRING = { stiffness: 200, damping: 15, precision: 0.1 }
const AnimationExample = () => (
<Router>
<div>
<ul>

PocketCHIP stuff

Utility

build in calculator: xcalc

use the built in browser: surf http://google.com (need help, man surf)

get a text browser: sudo apt-get install lynx

@gbaman
gbaman / HowToOTGFast.md
Last active May 14, 2024 10:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

gulp.task('css-browsersync', function() {
return gulp.src(["*.scss"])
.pipe(sass().on('error', function(err) {
console.error(err.message);
browserSync.notify(err.message, 3000); // Display error in the browser
this.emit('end'); // Prevent gulp from catching the error and exiting the watch process
}))
.pipe(gulp.dest("public/"))
.pipe(browserSync.stream());
});
@d2s
d2s / installing-node-with-nvm.md
Last active March 13, 2024 12:09
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@georgestephanis
georgestephanis / myhacks.php
Created February 3, 2016 23:58
This is a tester for wp rest api authentication. You can call against unsecured and it'll always work, but change to secured and it'll only work for authed admins.
<?php
add_action( 'rest_api_init', 'myhacks_init' );
function myhacks_init() {
register_rest_route( 'myhacks', '/unsecured', array(
'methods' => 'GET',
'callback' => 'myhacks_response',
) );
@NamPNQ
NamPNQ / bitcoin-cpuminer.sh
Last active August 22, 2018 03:11 — forked from return1/bitcoin-cpuminer.sh
install a bitcoin cpuminer on ubuntu/debian
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git gcc -y
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"