Skip to content

Instantly share code, notes, and snippets.

@fahimc
fahimc / gist:7672931
Last active December 29, 2015 12:49
on mouse out check if mouse has left the correct element and doesn't execute a mouse out when you are over a child element.
this.onMouseOut = function(event) {
var overlay = document.getElementById(this.overlayId);
var target = event.target, related = event.relatedTarget, match;
// search for a parent node matching the delegation selector
while (target && target != document && !( match = this.matches(target, "." + this.constant.SECTION_OVERLAY_CLASS) )) {
target = target.parentNode;
}
@fahimc
fahimc / Interface.js
Last active August 29, 2015 14:27
This is a simple Script to create Interfaces in Javascript. You can create a new interface and implement it to a class. No Libraries required.
/*
Author: Fahim Chowdhury 2015
Interface.js
This is a simple Script to create Interfaces in Javascript.
You can create a new interface and implement it to a class.
No Libraries required.
*/
(function() {
Interface = function(name, methods) {
@fahimc
fahimc / Class.js
Last active August 29, 2015 14:27
This is a simple Script to help write Classes in Javascript. You can create a class, extend a class and implement interfaces (requires Interface.js) Write your code in pure JS as this is just a helper. No Libraries required.
/*
Author: Fahim Chowdhury 2015
Class.js (https://gist.github.com/fahimc/d6b6b2f934e6fa9b4ae3)
This is a simple Script to help write Classes in Javascript.
You can create a class, extend a class and implement interfaces (requires Interface.js https://gist.github.com/fahimc/6e64e7b7d6ece272243f)
Write your code in pure JS as this is just a helper.
No Libraries required.
*/
var Class=function(name){
window[name] = function(){};
@fahimc
fahimc / jim.js
Created September 23, 2015 09:34
for Jim
//convert current items to the new structure
/*
copy this code and run it once. goto your browser and press F12 and in the console you should see the output of your new structure.
Copy it into your project.
DELETE after you have your 300 items converted!
*/
var text = ['"sdkjh sdjshd kjsdhdkhd s djhsd." john henry','"sdkjh sdjshd kjsdhdkhd s djhsd fjhdfkjhdf." jimmy fallon'];
var collection = [];
for(var a=0;a<text.length;a++){
@fahimc
fahimc / project-readme.md
Last active May 22, 2016 08:56
Project readme template
@fahimc
fahimc / .editorconfig
Created June 2, 2016 12:59
editor config
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@fahimc
fahimc / chair.js
Last active February 23, 2017 12:05
Goldilocks Code
class Chair {
constructor(weight){
this.maxWeight = weight;
}
}
export default Chair;
<!DOCTYPE html>
<html>
<head>
<title> </title>
<style type="">
img { visibility: hidden; } canvas { visibility: hidden; } #main{ visibility: visible;; }
#videoHolder{
height: 30px;
overflow: hidden;
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}