Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

appkr appkr

🎯
Focusing
View GitHub Profile
@appkr
appkr / gist:b77c39fbe3f903555e27
Created Jan 28, 2015
Html meta tag for Social Graph integration
View gist:b77c39fbe3f903555e27
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="">
<meta name="twitter:creator" content="">
<meta name="twitter:title" content="">
<meta name="twitter:description" content="">
<meta name="og:title" content="">
@appkr
appkr / index.html
Created Jan 28, 2015
JavaScript DocumentFragment // source http://jsbin.com/yayoni
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="JavaScript DocumentFragment" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>Knights of the Week !</h1>
@appkr
appkr / jsbin.necegu.js
Last active Aug 29, 2015
JavaScript Inheritance for Performance// source http://jsbin.com/necegu
View jsbin.necegu.js
//noprotect
function SignalFire(ID, startingLogs) {
this.fireID = ID;
this.logsLeft = startingLogs;
}
SignalFire.prototype = {
addLogs: function(numLogs) {
this.logsLeft += numLogs;
@appkr
appkr / jsbin.gepage.js
Last active Aug 29, 2015
JavaScript This Keyword// source http://jsbin.com/gepage
View jsbin.gepage.js
// "this" keyword
var makeRequest = function(url, callback) {
var data = 10; // Ajax
callback(data);
};
var obj = {
someValue : 20,
loadData: function(data) {
var sum = this.someValue + data;
@appkr
appkr / jsbin.muraqe.js
Last active Aug 29, 2015
JavaScript Data & Accessor// source http://jsbin.com/muraqe
View jsbin.muraqe.js
var createPerson = function(firstName, lastName) {
var person = {};
Object.defineProperties(person, {
firstName : {
value : firstName,
enumerable : true
},
lastName : {
value : lastName,
@appkr
appkr / jsbin.mawohi.js
Last active Aug 29, 2015
JavaScript Parachutic Inheritance// source http://jsbin.com/mawohi
View jsbin.mawohi.js
var createPerson = function(firstName, lastName) {
var person = {
firstName : firstName,
lastName : lastName,
sayHello : function () {
return "Hi there?";
}
};
Object.defineProperty(person, "fullName", {
@appkr
appkr / jsbin.hiteva.js
Last active Aug 29, 2015
JavaScript Prototypal Inheritance// source http://jsbin.com/hiteva
View jsbin.hiteva.js
var Person = function(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
};
Object.defineProperties(Person.prototype, {
sayHi : {
value : function () {
return "Hi there";
},
@appkr
appkr / jsbin.xuvoga.js
Last active Aug 29, 2015
JavaScript Constructor// source http://jsbin.com/xuvoga
View jsbin.xuvoga.js
var Person = function(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
};
// every object from Person has below properties.
Object.defineProperties(Person.prototype, {
sayHi : {
value : function () {
return "Hi there ?";
@appkr
appkr / jsbin.kipame.js
Last active Aug 29, 2015
JavaScript Event Target// source http://jsbin.com/kipame
View jsbin.kipame.js
var EventTarget = function() {
Object.defineProperty(this, "__listeners", {
value: {}
});
};
Object.defineProperties(EventTarget.prototype, {
addListener: {
value: function(type, listener) {
if (typeof this.__listeners[type] === "undefined") {
@appkr
appkr / jsbin.noveqe.css
Last active Aug 29, 2015
JavaScript Toolbar Example - Add Event// source http://jsbin.com/noveqe
View jsbin.noveqe.css
.toolbar {
background-color: #c6c6c6;
/*height: 50px;*/
padding: 5px;
}
.toolbar-item {
display: inline-block;
height: 50px;
width: 50px;