Skip to content

Instantly share code, notes, and snippets.

@pvencill
pvencill / LDAPjs New User
Last active January 19, 2023 04:44
Creating a new user in LDAPjs; complete example.
var ldap = require('ldapjs');
var ssha = require('node-ssha256');
var BASE = 'ou=Users,dc=example,dc=org';
// default port for ldaps
var URL = 'ldaps://ldap.example.org/:636';
// user and pass are for existing user with rights to add a user
@pvencill
pvencill / gist:6ce03cd7ae02eef37d9c
Created June 16, 2014 13:27
Full example of an app using a custom REPL
'use strict';
var repl = require('repl'),
_ = require('lodash'),
inflection = require('inflection'),
history = require('repl.history'),
requireDirectory = require('require-directory'),
pkg = require('../package.json');
var app = require('../');
@pvencill
pvencill / gist:27790e3850817605d58b
Created June 16, 2014 13:14
Basic use of a custom REPL in Node
'use strict';
var repl = require('repl'),
pkg = require('../package.json');
var r = repl.start({
prompt: pkg.name + ' >',
input : process.stdin,
output: process.stdout
});
@pvencill
pvencill / Gemfile
Created December 15, 2011 12:32
The error from heroku
require 'rbconfig'
HOST_OS = RbConfig::CONFIG['host_os']
source 'http://rubygems.org'
gem 'rails', '3.1.3'
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
@pvencill
pvencill / gist:1180690
Created August 30, 2011 11:19
db:seed trace
** Invoke db:seed (first_time)
** Invoke db:seed:common (first_time)
** Invoke db:seed:original (first_time)
rake aborted!
Circular dependency detected: TOP => db:seed => db:seed:common => db:seed:original => db:seed:common
/Users/pvencill/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/invocation_chain.rb:18:in `append'
/Users/pvencill/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/invocation_chain.rb:28:in `append'
/Users/pvencill/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:150:in `invoke_with_call_chain'
/Users/pvencill/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/pvencill/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
@pvencill
pvencill / gist:1180687
Created August 30, 2011 11:17
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.9)
actionpack (= 3.0.9)
mail (~> 2.2.19)
actionpack (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)