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 / 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');
@agileminds1997
agileminds1997 / countries.json
Created August 14, 2021 11:20 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@agileminds1997
agileminds1997 / countries.json
Created August 4, 2021 10:59 — forked from bensquire/countries.json
JSON Country List based on the ISO-3366-1 Alpha-3 Codes, with eu countries marked
[
{
"code": "AFG",
"name": "Afghanistan",
"eu": false
},
{
"code": "ALA",
"name": "Åland Islands",
"eu": false