I hereby claim:
- I am hypesystem on github.
- I am hypesystem (https://keybase.io/hypesystem) on keybase.
- I have a public key ASAAUdHwkLmLQJRdaklSiNeae5ujL4exU0j6HXhApB6yiQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
module.parent
in a node app refers to the parent module of the current module.
This is useful for getting paths (for example) relative to the parent, for example used internally in fileGetter:
// Should get localPath in ./, not localPath in ./lib/some-folder
var fileGetter = require("./lib/some-folder/file-getter.js");
var text = fileGetter("./localPath.dat");
{ | |
_id: "_design/user_actions", | |
_rev: "some-revision", | |
views: { | |
what_ever: { | |
map: function(doc) { | |
// ... | |
} | |
} | |
}, |
function insignificantOrderDeepContains(haystack, needle) { | |
var matched = false; | |
haystack.forEach(function(straw) { | |
if(matched) return; | |
if(insignificantOrderDeepEquals(straw, needle)) { | |
matched = true; | |
} | |
}); | |
return matched; | |
} |
<?php | |
header("Content-Type: application/json"); | |
echo json_encode(array( | |
"name" => "Wilson", | |
"gender" => "Ball", | |
"age" => "13" | |
)); | |
?> |
var PublicClass = function() { | |
this.state = "something"; | |
} | |
PublicClass.prototype.publicMethod = function() { | |
privateFunction.call(this); //<-- this is a dirty, dirty trick, running *privateFunction* as a private method | |
}; | |
function privateFunction() { | |
console.log(this.state); //<-- in order to make *this* accessible, we need to use the trick above |
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/// <summary> | |
/// Generic implementation of Martin Fowler's Enterprise Pattern ``Range'': | |
/// http://martinfowler.com/eaaDev/Range.html | |
/// |
using System.Collections.Generic; | |
using System.Linq; | |
///<summary> | |
///Original: http://3dk.easycruit.com/vacancy/1161591/3032?iso=dk | |
///Their own repost: https://3dk.easycruit.com/vacancy/1385970/3032?iso=dk | |
///</summary> | |
namespace JobAd | |
{ | |