Skip to content

Instantly share code, notes, and snippets.

@lukexie
lukexie / daemon_fork_twice.py
Last active February 24, 2019 13:16 — forked from cannium/gist:7aa58f13c834920bb32c
example for double fork
# c.f. https://stackoverflow.com/a/5386753
import os
import sys
print('pre-fork: pid=%d, pgid=%d, sid=%d' % (os.getpid(), os.getpgid(0), os.getsid(0)))
pid = os.fork()
if pid > 0:
sys.exit(0)
@pervognsen
pervognsen / BTree.cpp
Created April 25, 2016 01:58
B-tree with iterators and more aggressive deletion
enum { BMAX = 32, BMIN = BMAX / 2, BHEIGHT = 6 };
struct BNode {
uint32_t length;
Key keys[BMAX];
union {
BNode *children[BMAX];
Value values[BMAX];
};
};
@Riketta
Riketta / huffmancode.cpp
Last active June 5, 2019 04:22
Huffman Encoding - Coder + Decoder
// developed by Riketta - rowneg@bk.ru
#include <iostream>
#include <vector>
#include <list>
#include <map>
using namespace std;
class Node

Полезно научиться работать с большими 7z архивами, с сетью, и с большими 7z архивами, доступными по сети. Рассмотрим на примере набора данных с kaggle объемом 8 Гб…

http://vk.cc/50eTT0

Посмотрим что там лежит.

$ host vk.cc
vk.cc has address 95.213.4.232
vk.cc has address 95.213.4.233
vk.cc has address 95.213.4.230
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 1, 2024 17:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
// by Rulexec
// http://com.muna.by/people/ruliov
var net = require('net'),
CRC32Stream = require('crc32-stream').CRC32Stream;
var client = net.connect(443, '149.154.167.50', function() {
console.log('connected');
var packet = createPacket();
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@githubjeka
githubjeka / installing.md
Last active November 20, 2018 21:36
How install PHP 5.6.0, Nginx, php-fpm on Debian

#Download Sorce PHP

mkdir /opt/php-5.6.0
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.6.0.tar.bz2/from/this/mirror -O php-5.6.0.tar.bz2
tar jxf php-5.6.0.tar.bz2
cd php-5.6.0/