Skip to content

Instantly share code, notes, and snippets.

View shimondoodkin's full-sized avatar

Shimon Doodkin shimondoodkin

View GitHub Profile
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#include <v8.h>
#include <node.h>
#include <node_os.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#ifndef SRC_OS_H_
#define SRC_OS_H_
#include <node.h>
#include <v8.h>
#include <sys/types.h>
#include <pwd.h> /* getpwuid() */
#include <grp.h> /* getgrgid() */
var types = {
'.3gp' : 'video/3gpp',
'.a' : 'application/octet-stream',
'.ai' : 'application/postscript',
'.aif' : 'audio/x-aiff',
'.aiff' : 'audio/x-aiff',
'.asc' : 'application/pgp-signature',
'.asf' : 'video/x-ms-asf',
'.asm' : 'text/x-asm',
'.asx' : 'video/x-ms-asf',
@tsmith
tsmith / gist:758517
Created December 29, 2010 13:04
three minute cloud server illustration with node-control
/*global require */
// Illustration-only for a mailing list discussion - not a recommended pattern
// for production because of root usage. Untested.
// http://groups.google.com/group/nodejs/browse_thread/thread/b41ad5d727d8dff8
// usage example:
// node thisfile.js local server:create
// node thisfile.js local server:stop <IP>
// node thisfile.js local server:start <IP>
@jacknab
jacknab / gist:4026553
Created November 6, 2012 18:28 — forked from strangerstudios/gist:1389944
Paid Memberships Pro Extra Checkout/Profile Fields Example
<?php
/*
Adding First and Last Name to Checkout Form
*/
//add the fields to the form
function my_pmpro_checkout_after_password()
{
if(!empty($_REQUEST['firstname']))
$firstname = $_REQUEST['firstname'];
// (c) copyright unscriptable.com / John Hann | LegendLee
// License MIT
// For more robust promises, see https://github.com/briancavalier/when.js.
// last edited by LegendLee(legendlee1314@gmail.com)
function Promise() {
this._thens = [];
}
Promise.prototype = {
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@aniongithub
aniongithub / CMakeLists.txt
Last active June 26, 2019 19:40
Building native Node.js modules with node-cmake, nbind and conan
cmake_minimum_required(VERSION 3.1)
project(nbind VERSION 1.0.0)
add_definitions(-DBUILDING_NODE_EXTENSION)
add_definitions(-DUSING_V8_SHARED)
add_definitions(-DUSING_UV_SHARED)
add_definitions(-DV8_DEPRECATION_WARNINGS)
include(node_modules/node-cmake/NodeJS.cmake)
@7shi
7shi / BitWriter.bas
Created April 13, 2012 14:20
VBA版Deflate
' public domain
Option Explicit
Private FOut%
Private buf() As Byte
Private bufp&, cur&, bit%
Public Sub BitWriter_Init(FO%)
ReDim buf(4095)
FOut = FO
@yuval-a
yuval-a / gist:ad8dd131506c56da2a634693db72e2c9
Last active April 19, 2021 08:15
str_length that ignores Hebrew "nikud" characters
function str_length(str) {
let length = 0, nikud_chars = /[ְֱֲֳִֵֶַָֹֻּׁׂ]/;
for (let i=0,len=str.length;i<len;i++)
length += nikud_chars.test(str[i]) ? 0 : 1;
return length;
}