Skip to content

Instantly share code, notes, and snippets.

View danleyb2's full-sized avatar
:octocat:
...

Nyaundi Brian danleyb2

:octocat:
...
View GitHub Profile
@danleyb2
danleyb2 / package.json
Created July 23, 2020 12:06
License Plate Recognition on Plate Recognizer of remote image without saving to a tmp file
{
"name": "l1",
"version": "1.0.0",
"description": "",
"main": "remote_img_recognizer.js",
"dependencies": {
"form-data": "^3.0.0",
"node-fetch": "^2.6.0"
},
"devDependencies": {},
@danleyb2
danleyb2 / debugger pause beforeunload
Created May 30, 2020 10:03 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@danleyb2
danleyb2 / bot_example.py
Created May 2, 2020 12:34 — forked from EvieePy/bot_example.py
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@danleyb2
danleyb2 / footer.php
Last active March 20, 2020 10:28
Php Include Header and Footer from a root
@danleyb2
danleyb2 / fetch_csv.js
Created March 16, 2020 08:18
Fetch Csv
// const csvFile = 'latest_by_country.csv';
// fetch(csvFile).then(function(response) {
//
// return response.ok ? response.text() : Promise.reject(response.status);
//
//
// }).then(function(text) {
// console.log(text);
//
// });a
@danleyb2
danleyb2 / custom.element.js
Created December 12, 2019 17:23 — forked from argyleink/custom.element.js
custom element with shadow dom
export default class CustomElement extends HTMLElement {
constructor() {
super()
this.$shadow = this.attachShadow()
this.$shadow.innerHTML = this.render()
}
connectedCallback() {}
disconnectedCallback() {}
@danleyb2
danleyb2 / monitor.sh
Created October 1, 2019 09:15 — forked from indatawetrust/monitor.sh
redis-cli monitor grep
redis-cli monitor | grep -E ' "set" '
@danleyb2
danleyb2 / fancy-tabs-demo.html
Created August 2, 2019 09:39 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@danleyb2
danleyb2 / curl.md
Created June 11, 2019 07:08 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@danleyb2
danleyb2 / mixin.js
Created April 24, 2019 10:12 — forked from cowboy/mixin.js
JavaScript ES6 - mixins with super
// This mixin might be used to extend a class with or without its
// own "foo" method
const mixin = Base => class extends Base {
foo() {
// Only call super.foo() if it exists!
if (super.foo) {
super.foo();
}
console.log('mixin');