Skip to content

Instantly share code, notes, and snippets.

View idpokute's full-sized avatar
🎲
Focusing

Mike Sehui Park idpokute

🎲
Focusing
  • Toronto
View GitHub Profile
@idpokute
idpokute / machine.js
Last active October 26, 2022 20:32
Generated by XState Viz: https://xstate.js.org/viz
const idleMachine = Machine(
{
id: "idle",
initial: 'idle',
states: {
idle: {
entry: 'logEntry',
exit: 'logExit'
}
},
@idpokute
idpokute / git-deployment.md
Created May 25, 2020 12:24 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@idpokute
idpokute / actual-filtering-function.php
Created February 13, 2020 04:05 — forked from bryanwillis/actual-filtering-function.php
Easily Modify genesis theme framework classes on the fly using genesis_attr();
<?php
/**
* Adds Filters Automatically from Array Keys
*/
add_action('genesis_meta', 'bw_add_array_filters_genesis_attr');
function bw_add_array_filters_genesis_attr()
{
$filters = bw_merge_genesis_attr_classes();
foreach(array_keys($filters) as $context) {
@idpokute
idpokute / gist:571466b5ff9d8b3e0142a2b205221501
Created October 30, 2019 15:55
Simply Get Random Color using Javascript
// get random color
background-color: ${"#" + (0x1000000 + Math.random() * 0xffffff).toString(16).substr(1, 6)};
@idpokute
idpokute / functions.php
Created October 16, 2019 14:33
Wordpress REST API V2 - list taxonomy terms.
/*
Following code is solved the return type issue and if condition syntax error. The original code that is from Stackoverflow, but it had two issues; return type is not consistent and a logical sytax error.
original: https://stackoverflow.com/questions/42462187/wordpress-rest-api-v2-how-to-list-taxonomy-terms
endpoint: http://youdomain.com/wp-json/wp/v2/all-terms?term=you_taxonomy
*/
class All_Terms {
public function __construct() {
@idpokute
idpokute / class-custom-walker.php
Created May 16, 2019 14:41
Wordpress Walker 101
<?php
class CustomWalker extends Walker {
public $tree_type = 'category';
public $db_fields = array(
'parent' => 'parent',
'id' => 'term_id',
);
public function start_lvl( &$output, $depth = 0, $args = array() ) {
$output .= "<ul class='children'>\n";
@idpokute
idpokute / gulpfile.js
Created October 6, 2017 19:44 — forked from Falconerd/gulpfile.js
Gulp + Watchify + Babelify + BrowserSync
/**
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
*
* TODO:
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
*
* The expected project is to be laid out as such:
*
@idpokute
idpokute / tmux-cheatsheet.markdown
Created December 2, 2016 16:31 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname