We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
// Douglas Crockford's once | |
// Part 5: The End of All Things, Slide 39 | |
// Once or throw exception | |
function once(func) { | |
return function () { | |
var f = func; | |
func = null; | |
return f.apply(this, arguments); | |
} |
# coding:utf-8 | |
import gc | |
import inspect | |
import weakref | |
from django.core.management.base import BaseCommand, CommandError | |
from django.dispatch import Signal | |
REF_TYPES = (weakref.ReferenceType,) |
var Benchmark = require('benchmark'); | |
Benchmark.prototype.setup = function() { | |
a = ["test"]; | |
for (var i = 0; i < 10000; i++) { | |
a.push("some other stuff"); | |
} | |
s = a.join(); | |
re1 = new RegExp("^test"); | |
re2 = new RegExp("^not there"); | |
}; |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
# New repository | |
mkdir <repo> && cd <repo> | |
git init | |
git remote add –f <name> <url> | |
git config core.sparsecheckout true | |
echo some/dir/ >> .git/info/sparse-checkout | |
echo another/sub/tree >> .git/info/sparse-checkout | |
git pull <remote> <branch> | |
# Existing repository |
Update: 2023/11/30 Bruce Momjian's take on things: https://momjian.us/main/blogs/pgblog/2023.html#November_22_2023
Given a table...
CREATE TABLE foo (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
...
);
$ cat test.js | |
function foo () { while (true) { } } | |
function bar () { return foo(); } | |
bar(); | |
$ node test.js & | |
$ gdb attach $(pidof node) | |
0x00000bf778c63d5f in ?? () | |
(gdb) b v8::internal::Runtime_StackGuard | |
Breakpoint 1 at 0x84a1f0 | |
(gdb) print 'v8::V8::TerminateExecution'(0) |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
I managed to recover this post by checking Google's cached copy as it was randomly taken down; Enjoy!
Surpassing 100GB of data in your application requires you to have in-depth knowledge of how to operate and run MongoDB. MongoHQ recommends going through the 100GB Scaling Checklist as you grow. Watch the webinar recording on the subject for the full overview:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.