Skip to content

Instantly share code, notes, and snippets.

View justinriggio's full-sized avatar

Justin Riggio justinriggio

  • NYC
View GitHub Profile
@justinriggio
justinriggio / index.html
Created September 27, 2014 01:49
Angular Bootstrap Product List Angular Bootstrap Product List // source http://jsbin.com/naheq/3
<!DOCTYPE html>
<html ng-app="videoGameStore">
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta name="description" content="Angular Bootstrap Product List" />
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>Angular Bootstrap Product List</title>
@justinriggio
justinriggio / index.html
Created September 24, 2014 23:35
Famo.us Mobile App Example Famo.us Mobile App Example // source http://jsbin.com/poyah/5
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Famo.us Mobile App Example" />
<meta charset="utf-8">
<title>Famo.us Mobile App Example</title>
<meta name="viewport" content="width=device-width, maximum-scale=1, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@justinriggio
justinriggio / index.html
Created September 24, 2014 23:34
Famo.us FormContainerSurface Famo.us FormContainerSurface // source http://jsbin.com/bekona/3
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Famo.us FormContainerSurface" />
<meta charset="utf-8">
<title>Famo.us FormContainerSurface</title>
<meta name="viewport" content="width=device-width, maximum-scale=1, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@justinriggio
justinriggio / linecount.sh
Created November 9, 2013 15:08
Count lines in files. Nice to check out how many lines of code you have.
#!/bin/sh
find . -name '*.js' | xargs wc -l
@justinriggio
justinriggio / gist:7032587
Created October 17, 2013 21:34
python simple http server info
Open up a terminal and type:
$ cd /home/somedir
$ python -m SimpleHTTPServer
That's it! Now your http server will start in port 8000. You will get the message:
Serving HTTP on 0.0.0.0 port 8000 ...
Now open a browser and type the following address:
http://192.168.1.2:8000
@justinriggio
justinriggio / gist:6999733
Created October 15, 2013 22:35
Pretty print mongo collection
$ mongo --quiet dbname --eval 'printjson(db.collection.find().toArray())' > output.json
@justinriggio
justinriggio / gist:6553527
Created September 13, 2013 17:23
force kill meteor
ps ax | grep node | grep meteor
kill -9 <id>
@justinriggio
justinriggio / addpackage.sh
Created September 3, 2013 06:16
adds atmosphere package and reset meteorite takes one arg the smart package name
#!/bin/bash
#add a smart package and reset meteorite
PACKAGE=$1
mrt add $PACKAGE
rm -rf /home/$USER/.meteorite
mrt install
upstream my_upstream { #this line starts the list of real resources that exist behind the nginx server
server 127.0.0.1:1337;
server 127.0.0.1:1338; #these servers are used in the order they are defined, in round robin fashion. there's more ways of load balancing in the docs
server 127.0.0.1:1339 backup; #amazingness no.1, the keyword "backup" means that this server should only be used when the rest are non-responsive
keepalive 64;
}
server {
listen 80;
location /resource.html { #in my example the server only responds to requests for the file /request.html
@justinriggio
justinriggio / startup.sh
Last active December 21, 2015 05:49
quick script to run
#!/bin/sh
export MONGO_URL='mongodb://localhost:27017/appname'
export ROOT_URL='http://domain.com'
export MAIL_URL='smtp://[email protected]:587'
node main.js
#forever main.js