Skip to content

Instantly share code, notes, and snippets.

View mugizico's full-sized avatar
:shipit:

Cheeky Panda mugizico

:shipit:
  • Atlanta, GA
View GitHub Profile
jQuery.sharedCount = function(url, fn) {
url = encodeURIComponent(url || location.href);
var arg = {
url: "//" + (location.protocol == "https:" ? "sharedcount.appspot" : "api.sharedcount") + ".com/?url=" + url,
cache: true,
dataType: "json"
};
if ('withCredentials' in new XMLHttpRequest) {
arg.success = fn;
}
@mugizico
mugizico / Contact.js
Last active May 19, 2016 18:38
findContacts function
Command.add = function(done){
var str = this.getOperationData()
var c = Contact.createContact(str)
Contact.saveContact = function (err , c){
if(err) { return done(err)}
@mugizico
mugizico / ProductsOfInts.java
Created July 21, 2015 23:54
Interview Cake #2 : Products of all integers at that index
/*
*You have an array of integers,
*and for each index you want to find the product of every
*integer except the integer at that index
*
*Bruteforce Approach:
*0(n^2) go through every index and multiply with every nested_index except when index = nested_index
* [Better] Greedy Approach:
* 0(n) time and space: go through greedly twice
* once to multiply before index integers and second for after index integers
@mugizico
mugizico / README.md
Created October 8, 2015 22:04 — forked from mbostock/.block
Epicyclic Gearing

From Wikipedia:

Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Use the menu in the top-left to change the frame of reference, fixing the specified gear in-place.

@mugizico
mugizico / hn_seach.js
Created April 1, 2016 19:08 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments),
shown = 0, total = job_list.length;
// Traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
@mugizico
mugizico / IntersectionSearch.java
Created May 19, 2016 18:37
Find an Intersection between two integer arrays
/*
* Example Arr1 = {2,3,7,9,20,35} ; Arr2 = { 3,9,21,35,89,100,200}, Intersection = {3,9,35}
* Assumptions:
* Both Arrays are sorted
* Both Arrays contain at least one element
* Arr2 >> Arr1
* n is Arr1.length, m is Arr2.length
* Possible Solutions:
* (1) Brute-force : run O(nm) - inefficient
* (2)HashSet/Map : O(n+m) runtime, O(k) additional space k = size of hashset/map
@mugizico
mugizico / pa11y-crawl-troubleshooting.md
Last active September 26, 2016 20:59
Pa11y-Crawl Installation and Running issues

pa11y-crawl was not running as desired on computer.

  • Running 'pa11y-crawl -v' yields cat: no package.json file or directory found

solution: none figured out so far still a work in progress

  • Running 'pa11y-crawl -d /path/to/dir' loops you back to the Usage: pa11y-crawl [options] <URL> Options:…. message

solution: make sure to provide a third argument like so pa11y-crawl -d /path/to/dir whatever
for e.g pa11y-crawl -d _site 18fsite the last argument is because the command is set to show the help if there’s no non-option arguments (which is what the url would be, in most cases)

Keybase proof

I hereby claim:

  • I am mugizico on github.
  • I am mugizico (https://keybase.io/mugizico) on keybase.
  • I have a public key ASByd05_02uy1IvcR-0PNKXk29qOAku4T27XnEam4LoFOwo

To claim this, I am signing this object:

@mugizico
mugizico / Kitchen-CheetSheet.md
Created June 27, 2017 18:37 — forked from arttuladhar/Kitchen-CheetSheet.md
Chef and Knife Commands CheatSheet

Kitchen Commands

kitchen list
kitchen create
kitchen login <InstanceName>