Skip to content

Instantly share code, notes, and snippets.

@leommoore
leommoore / node_child_processes.markdown
Last active May 30, 2023 08:22
Node - Child Processes

#Node - Processes To launch an external shell command or executable file you can use the child_process. Apart from command line arguments and environment variables you cannot communicate with the process using child_process.exec. However you can use child_process.spawn to create a more integrated processes.

##Executing Child Processes

###To launch an external shell command

var child_process = require('child_process');
var exec = child_process.exec;
@MaskRay
MaskRay / Gruntfile.coffee
Created March 1, 2013 16:17
Gruntfile.coffee
module.exports = (grunt) ->
'use strict'
grunt.initConfig
coffee:
debug:
files: [
expand: true
cwd: 'js'
src: ['**/*.coffee', '!**/_*.coffee']
// ==UserScript==
// @name Test Window 27
// @namespace http://use.i.E.your.homepage/
// @version 0.2
// @description enter something useful
// @match http://tampermonkey.net/test/jquery.html
// @run-at document-body
// @copyright 2012+, You
// ==/UserScript==
@Wizmann
Wizmann / xiami_cracker.py
Last active December 16, 2015 18:21
下载虾米音乐
# coding=utf-8
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.queue
import requests
import sys
import re
import os
#!/bin/bash -e
# $File: setup-ipv6.sh
# $Date: Fri Mar 07 13:00:05 2014 +0800
# $Author: jiakai <[email protected]>
PREFIX='2402:f000:1:1501:200:5efe'
ADDR_LOCAL=$(ip r g 8.8.8.8 | grep src | awk '{print $7}')
ADDR_OUT=$(curl ifconfig.me)
ADDR_REMOTE='166.111.21.1'
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@kachayev
kachayev / concurrency-in-go.md
Last active August 22, 2024 14:20
Channels Are Not Enough or Why Pipelining Is Not That Easy
@imneme
imneme / randutils.hpp
Last active September 25, 2024 13:41
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@koreno
koreno / README.md
Last active April 1, 2020 10:44
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.

Prebase

git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.

  • Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
  • Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).

Installation

Add the executable to your path and git will automatically expose it as

#define _GNU_SOURCE 1
#include <sched.h> // sched_setaffinity
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
#include <assert.h>
#include <sys/time.h>