- No blank nicknames.
- No inappropriate nicknames.
- No sexually explicit nicknames.
- No offensive nicknames.
- No nicknames with unusual or unreadable Unicode.
- No inappropriate profile pictures.
Verifying my Blockstack ID is secured with the address 1KNLvToa8S8Ga2jeen3PNAjdjmX1cWbcMx https://explorer.blockstack.org/address/1KNLvToa8S8Ga2jeen3PNAjdjmX1cWbcMx |
// Whats Better? | |
// more indentation | |
function myFunction(data){ | |
if(data){ | |
// do some important stuff | |
data.parse() | |
} | |
} |
Partials are basically functions that return functions with some already predefined arguments and need some arguments to be completed. Let's say you have a function with several arguments to be set, but you don't want to set the majority of arguments over and over again because you need it more than once.
# my useless function to write something to the dom
function writeSomethingToDom(element, content){
element.append(content);
}
# use the function repeatedly
From the underscore.js documentation :
Returns the composition of a list of functions, where each function consumes the return value of the function that follows. In math terms, composing the functions f(), g(), and h() produces f(g(h())).
So what compose() basically does is, glueing functions together and returning a new function. Thats a really functional approach i like. You dont deal with passing around data, instead you declare some functions into a new one and apply it to your content.
Lets say you have some "useful", small standalone functions:
//----Get all divs on page--------- | |
/* jQuery */ | |
$("div") | |
/* native equivalent */ | |
document.getElementsByTagName("div") | |
//----Get all by CSS class--------- | |
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on |
//Browsers | |
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/ | |
var IE7 = (document.all && !window.opera && window.XMLHttpRequest && navigator.userAgent.toString().toLowerCase().indexOf('trident/4.0') == -1) ? true : false; | |
var IE8 = (navigator.userAgent.toString().toLowerCase().indexOf('trident/4.0') != -1); | |
var IE9 = navigator.userAgent.toString().toLowerCase().indexOf("trident/5")>-1; | |
var IE10 = navigator.userAgent.toString().toLowerCase().indexOf("trident/6")>-1; | |
var SAFARI = (navigator.userAgent.toString().toLowerCase().indexOf("safari") != -1) && (navigator.userAgent.toString().toLowerCase().indexOf("chrome") == -1); | |
var FIREFOX = (navigator.userAgent.toString().toLowerCase().indexOf("firefox") != -1); | |
var CHROME = (navigator.userAgent.toString().toLowerCase().indexOf("chrome") != -1); | |
var MOBILE_SAFARI = ((navigator.userAgent.toString().toLowerCase().indexOf("iphone")!=-1) || (navigator.userAgent.toString().toLowerCase().indexOf("ipod")!=-1) || (navigator.userAgent.toString().toLowerCase().indexOf(" |
var createGame = require('voxel-engine') | |
function sphereWorld(x, y, z) { | |
// return the index of the material you want to show up | |
// 0 is air | |
if (x*x + y*y + z*z > 15*15) return 0 | |
return 3 | |
} | |
var game = createGame({ |
// page one: set cookie after successful login | |
setCookie("myLogin", "Username or a different String", 2); | |
// page two: get cookie with this variable name | |
var cookie = readCookie("myLogin"); | |
// redirect if theres no cookie with this variable | |
if (!cookie) { | |
// redirect to page one |