Skip to content

Instantly share code, notes, and snippets.

@pwFoo
pwFoo / form-input.css
Created December 5, 2016 18:50
input checkbox / radio font awesome support
/* hide default checkbox if checked */
input[type='checkbox'].fa-replace:checked,
input[type='radio'].fa-replace:checked {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border:none;
border-radius: 0;
}
@pwFoo
pwFoo / Caddyfile
Created December 12, 2016 21:32 — forked from talbergs/Caddyfile
Docker[ Caddy php7 ]
0.0.0.0:80
fastcgi / phpfmp:9000 php
@pwFoo
pwFoo / ajax-ic.js
Last active March 5, 2017 21:39
jqSlim - jQuery-like API super-tinyJavaScript library based on ki.js. Ajax-ic is a minimal IntercoolerJS inspired jqSlim plugin.
/**
* Load Module if DOM is ready
*/
$(function () {
/**
* GET click events
*/
$('[ic-get]').on('click', function () {
icAjax(this, 'GET')
});
@pwFoo
pwFoo / disable_vim_auto_visual_on_mouse.txt
Created July 2, 2017 15:28 — forked from u0d7i/disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
@pwFoo
pwFoo / generate-dropbear-key
Created April 26, 2018 09:37 — forked from hongkongkiwi/generate-dropbear-key
Generate SSH Key in Dropbear
#!/bin/bash
KEY_DIR="/mnt/sda1/.ssh"
# Make directories
mkdir -p "$KEY_DIR"
# Generate an RSA key using dropbear
dropbearkey -t rsa -f "${KEY_DIR}/id_rsa"
@pwFoo
pwFoo / two-way-binding.js
Created November 24, 2018 15:01 — forked from straker/two-way-binding.js
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes
#!/usr/bin/env bash
set -eo pipefail
# from moby project - w/o go dependency (nailing amd64) and w/o jq dep (using
# python)
# hello-world latest ef872312fe1b 3 months ago 910 B
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B
# debian latest f6fab3b798be 10 weeks ago 85.1 MB
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB
@pwFoo
pwFoo / README.md
Created June 21, 2019 04:58 — forked from ibuildthecloud/README.md
k3s on WSL2
@pwFoo
pwFoo / ofilter.php
Created January 4, 2020 20:49 — forked from amnuts/ofilter.php
Filter an array of objects based on property, or multiple property values
<?php
/**
* Filter an array of objects.
*
* You can pass in one or more properties on which to filter.
*
* If the key of an array is an array, then it will filtered down to that
* level of node.
*
@pwFoo
pwFoo / get_latest_release.sh
Created February 1, 2020 21:08 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4