Skip to content

Instantly share code, notes, and snippets.

View SOSANA's full-sized avatar

Zach Sosana SOSANA

View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
//Database connection
var uristring = 'mongodb://localhost/test';
var mongoOptions = { };
mongoose.connect(uristring, mongoOptions, function (err, res) {
if (err) {
console.log('Error when connecting to: ' + uristring + '. ' + err);
@SOSANA
SOSANA / updateNpm.bat
Last active May 20, 2018 18:21
Update npm on windows using nvm-windows. Script runs latest, npm version just replace "latest" with version desired. Place script in nvm root folder C:\Users\<user>\AppData\Roaming\nvm or run %appdata% to locate nvm folder
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == ["latest"] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version="latest"
if "!wanted_version!" == "latest" (
for /f %%i in ('npm show npm version') do set wanted_version=%%i
@sturobson
sturobson / Sass-Books
Created October 21, 2014 09:59
Sass Books...
Sass in the real world (Book 1 of 4)
http://anotheruiguy.gitbooks.io/sassintherealworld_book-i/
Sass in the real world (Book 2 of 4)
http://anotheruiguy.gitbooks.io/sass-in-the-real-world-book-2-of-4/
Sass for web designers
@DanWahlin
DanWahlin / animations.css
Created December 22, 2013 01:25
Sample AngularJS animations.
.slide-animation.ng-enter, .slide-animation.ng-leave {
-webkit-transition: 0.5s linear all;
-moz-transition: 0.5s linear all;
-o-transition: 0.5s linear all;
transition: 0.5s linear all;
position:relative;
height: 1000px;
}
.slide-animation.ng-enter {
@betawax
betawax / hhvm.hdf
Created January 9, 2014 07:45
Laravel HHVM config
Server {
Port = 8080
SourceRoot = /var/www/foobar/public/
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@dtrce
dtrce / mp3.js
Created September 8, 2011 18:39
streaming mp3 using nodejs
var http = require('http'),
fileSystem = require('fs'),
path = require('path')
util = require('util');
http.createServer(function(request, response) {
var filePath = 'path_to_file.mp3';
var stat = fileSystem.statSync(filePath);
response.writeHead(200, {
@serdarb
serdarb / Download and Install MongoDB as Windows Service PowerShell Script
Last active July 26, 2023 12:22
A nice powershell that dowloads mongodb and installs it as windows service... this script is good for development machines.
Set-ExecutionPolicy RemoteSigned
$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9"
if ((Test-Path -path $mongoDbPath) -eq $True)
{
@dwayne
dwayne / 00-install-on-64-bit-ubuntu-14.04.md
Last active January 12, 2024 17:48
Installing node and npm on Ubuntu 12.04 LTS and 64-bit Ubuntu 14.04 LTS.
  1. Navigate to http://nodejs.org/download/ and on the Linux Binaries (.tar.gz) row click to download the 64-bit version of the current latest release.

  2. Say you've downloaded node-v0.10.7-linux-x64.tar.gz into the Downloads directory. Then, open the terminal and type the following:

$ cd ~/Downloads
$ mkdir -p ~/local/node
$ tar xzf node-v0.10.7-linux-x64.tar.gz -C ~/local/node --strip-components=1
$ echo '# Node Enviroment Setup' >> ~/.bashrc
$ echo 'export PATH=$HOME/local/node/bin:$PATH' &gt;&gt; ~/.bashrc