Skip to content

Instantly share code, notes, and snippets.

View AramZS's full-sized avatar
🎯
Focusing

Aram Zucker-Scharff AramZS

🎯
Focusing
View GitHub Profile
@hugosp
hugosp / app.js
Created April 4, 2016 22:37
Minimal express-ws broadcast to all clients
var express = require('express');
var expressWs = require('express-ws');
var expressWs = expressWs(express());
var app = expressWs.app;
app.use(express.static('public'));
var aWss = expressWs.getWss('/');
app.ws('/', function(ws, req) {
<?php
/**
* Make an internal REST request
*
* @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server).
* @param $request_or_method WP_REST_Request|string A WP_REST_Request object or a request method
* @param $path (optional) if the path is not specific in the rest request, specify it here
* @param $data (optional) option data for the request.
* @return WP_Error|mixed
@morganestes
morganestes / .git-commands.md
Last active June 17, 2016 18:48
Custom Git commands for bash

Git commands that I use enough that I decided to write them down.

INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@ftrain
ftrain / actually.js
Last active November 10, 2023 01:16
A program that generates actuallies
/*
actually.js
_ _ _
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( )
|___/|/
*/
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@yurivictor
yurivictor / hexagon.html
Last active December 22, 2015 09:59
CSS Hexagon
<style>
.hexagon {
height: 150px;
overflow: hidden;
transform: rotate(120deg);
width: 300px;
-webkit-transform: rotate(120deg);
-moz-transform: rotate(120deg);
-o-transform: rotate(120deg);
@getsource
getsource / heartbeat-comments.php
Last active December 21, 2015 05:08
Heartbeat Sample plugin
<?php
/*
Plugin Name: Heartbeat Comment Update
Description: Updates Comment Count on Dashboard with Heartbeat.
Author: Andrew Ozz, Mike Schroder
Version: 0.2
Author URI: http://www.getsource.net
*/
add_filter( 'heartbeat_received', 'wc_heartbeat_comment_count', 10, 3 );
@rvagg
rvagg / README.md
Last active April 21, 2024 08:33
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.