Skip to content

Instantly share code, notes, and snippets.

View agileminds1997's full-sized avatar
🏠
Working from home

Eric Masaba agileminds1997

🏠
Working from home
View GitHub Profile
@agileminds1997
agileminds1997 / .block
Created February 2, 2023 23:35 — forked from mbostock/.block
Force-Directed States of America
license: gpl-3.0
@agileminds1997
agileminds1997 / ajax.js
Created September 10, 2022 08:51 — forked from mikechau/ajax.js
Bootstrap Modal, ajax submit, and close on submit
$(function(){
$('#myFormSubmit').click(function(e){
e.preventDefault();
alert($('#myField').val());
$('#myModal').modal('hide')
/*
$.post('http://path/to/post',
$('#myForm').serialize(),
function(data, status, xhr){
// do something here with response;
[
"affenpinscher",
"afghan hound",
"afghan shepherd",
"aidi",
"airedale terrier",
"akbash",
"akita inu",
"alano español",
"alaskan klee kai",
@agileminds1997
agileminds1997 / css_colors.js
Created October 11, 2021 12:24 — forked from bobspace/css_colors.js
All of the CSS Color names as an array in javascript.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript array containing all of the color names listed in the CSS Spec.
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
const CSS_COLOR_NAMES = [
"AliceBlue",
"AntiqueWhite",
<?php
/**
* Input an object, returns a json-ized string of said object, pretty-printed
*
* @param mixed $obj The array or object to encode
* @return string JSON formatted output
*/
function json_encode_pretty($obj, $indentation = 0) {
switch (gettype($obj)) {
case 'object':
@agileminds1997
agileminds1997 / states_hash.json
Created September 2, 2021 11:51 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@agileminds1997
agileminds1997 / index.html
Created September 2, 2021 10:39
Missing Variable Solver
<div class="container">
<h1>Missing Variable</h1>
<div class="major">
<div class="input-group d2 ejif">
<div class="input-group-prepend">
<button class="btn btn-success" type="button">Mass</button>
</div>
<input id="v1" type="text" class="form-control thevar" placeholder="(g)"
onkeypress="return validNumeric(this, event)"
onchange="return cleanNumbers(this)"
@agileminds1997
agileminds1997 / index.pug
Created August 27, 2021 11:48
[PUG] Count Items
// Pills navs
ul.nav.nav-pills.mb-3#ex1(role='tablist')
li.nav-item(role='presentation')
a.nav-link.active#ex1-tab-1(data-mdb-toggle='pill', href='#ex1-pills-1', role='tab', aria-controls='ex1-pills-1', aria-selected='true') Where
li.nav-item(role='presentation')
a.nav-link#ex1-tab-2(data-mdb-toggle='pill', href='#ex1-pills-2', role='tab', aria-controls='ex1-pills-2', aria-selected='false') When
li.nav-item(role='presentation')
a.nav-link#ex1-tab-3(data-mdb-toggle='pill', href='#ex1-pills-3', role='tab', aria-controls='ex1-pills-3', aria-selected='false') People
// Pills navs
@agileminds1997
agileminds1997 / gist:f0ace3a69f59f719361f8e36c9708e52
Created August 23, 2021 09:34 — forked from IsaacCisneros/gist:d7f3cf4bf6c0573d0570
Sublime Text [Regular expression - Cheat sheet]
> Regular Expressions Cheat Sheet
> A regular expression specifies a set of strings that matches it. This cheat sheet is based off Python 3's Regular Expressions (http://docs.python.org/3/library/re.html) but is designed for searches within Sublime Text.
> Special Characters
\ Escapes special characters or signals a special sequence.
. Matches any single character except a newline.
^ Matches the start of the string.
$ Matches the end of the string.
* Greedily matches 0 or more repetitions of the preceding RE.
*? Matches 0 or more repetitions of the preceding RE.
@agileminds1997
agileminds1997 / gulpfile.basic.js
Created August 14, 2021 16:11
Simple gulp configuration with Pug, SCSS, ES6 and BrowserSync.
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var pug = require('gulp-pug');
var babel = require('gulp-babel');
var livereload = require('gulp-livereload');
var zip = require('gulp-zip');
var rev = require('gulp-rev');