from any directory on host machine, export entire db
$ mongodump -db myDatabaseName
now copy the /dump
folder to destination machine. from the destination machine:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
var path = require("path"); | |
var gulp = require("gulp"); | |
var less = require("gulp-less"); | |
var notify = require("gulp-notify"); | |
var rename = require("gulp-rename"); | |
var minifyCSS = require("gulp-minify-css"); | |
var uglify = require("gulp-uglifyjs"); | |
var livereload = require("gulp-livereload"); | |
var source = require("vinyl-source-stream"); |
// http://docs.mongodb.org/manual/tutorial/back-up-and-restore-with-mongodb-tools/ | |
// Backup | |
$ mongodump -u {username} -p {password} --db {db} --out {output} | |
// Restore | |
$ env LC_ALL=en_US.UTF-8 mongorestore --port {port number} --dbpath {db path} {path to the backup} |
#!/bin/sh | |
MONGODB_SHELL='/opt/mongodb/bin/mongo' | |
DUMP_UTILITY='/opt/mongodb/bin/mongodump' | |
DB_NAME='my_db' | |
date_now=`date +%Y_%m_%d_%H_%M_%S` | |
dir_name='db_backup_'${date_now} | |
file_name='db_backup_'${date_now}'.bz2' |
#!/bin/sh | |
# Output file for HTML5 video | |
# requirements: ffmpeg .6+ | |
# usage: ./html5video.sh infile.mp4 640x360 | |
target_directory='converted' | |
file=`basename $1` | |
filename=${file%.*} | |
filepath=`dirname $1` |
$.when( | |
sushi_roll(), | |
dispatch() | |
).done(function() { | |
console.log('accepted:', arguments[0], arguments[1]); | |
}); | |
var n = 0; | |
function dispatch() { | |
return $.Deferred(function(dispached) { |
/*! X-editable - v1.5.1 | |
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery | |
* http://github.com/vitalets/x-editable | |
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ | |
/** | |
Form with single input element, two buttons and two states: normal/loading. | |
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown. | |
Editableform is linked with one of input types, e.g. 'text', 'select' etc. | |
@class editableform |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
for (var i=1; i <= 20; i++) | |
{ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |