Skip to content

Instantly share code, notes, and snippets.

View Nowaker's full-sized avatar

Damian Nowak Nowaker

View GitHub Profile
@Nowaker
Nowaker / gist:5f5ba3fe049993da3811
Created January 21, 2016 04:03 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
#!/usr/bin/env node
var spdy = require('spdy'),
crypto = require('crypto'),
fs = require('fs');
b64decode = function(encoded) {
return new Buffer(encoded || '', 'base64').toString('utf8');
};
var http = require("http")
, util = require("sys") // 0.3.x: require("util")
, fs = require("fs")
, client = http.createClient(80, "example.com")
, request = client.request("POST", "/", {"host":"example.com"})
// send body chunks
request.write("hello, world")
// pump a file through
@Nowaker
Nowaker / devise.pl.yml
Created March 2, 2012 14:56
Devise 2.0.1 polish translation
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
# Devise v1.4.6 polish translation by saepia based on @rogal111's translation
# Devise 2.0.0 updates by @kszksz
# Language updates by @Nowaker - bardziej zrozumiałe instrukcje (np. unconfirmed - sama informacja, że konto jest
# nieaktywne nie jest wystarczająca - trzeba powiedzieć, co trzeba zrobić by je aktywować), bardziej naturalne zwroty
# (unikanie strony biernej, więcej emocji w witaniu itp.), zakomentowanie zdeprecjonowanych wiadomości,
# dodanie "update_needs_confirmation" (Devise 2.0.1?)
pl:
errors:
@Nowaker
Nowaker / iebuttonfix.js
Created March 1, 2012 13:00 — forked from kamranayub/iebuttonfix.js
IE 7 and below <button> tag value on POST fix
$(document).ready(function() {
if ($.browser.msie && ($.browser.version === "7.0" || $.browser.version === "6.0")) {
var getButtonValue = function($button) {
var label = $button.text();
$button.text('');
var buttonValue = $button.val();
$button.text(label);
return buttonValue;
}