Skip to content

Instantly share code, notes, and snippets.

@bvanasse
bvanasse / Is JSON String
Created September 8, 2014 19:47
Verifying: IS JSON
function IsJsonString(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
@bvanasse
bvanasse / Helpful Terminal Commands
Last active August 29, 2015 14:05
Collection of helpful terminal commands
//PROCESS MANAGEMENT
//see all processes
# ps aux | less
//select all processes
# ps -A
//The top program provides a dynamic real-time view of a running system. Type the top at command prompt:
# top
@bvanasse
bvanasse / Bootstrap Meteor Collection
Last active August 29, 2015 14:05
if the database is empty on server start, create some sample data
// https://github.com/meteor/meteor/blob/devel/examples/todos/server/bootstrap.js
// if the database is empty on server start, create some sample data.
Meteor.startup(function () {
if (Lists.find().count() === 0) {
var data = [
{name: "Name",
contents: [
["A", "B", "C"],
["One Language", "Simplicity", "Fun"]
@bvanasse
bvanasse / checkWindowSize
Last active August 29, 2015 14:05
Checking Standard Window Sizes
$( document ).ready(function(){
var w = checkWindowSize();
$("body").removeClass("tiny small medium large xlarge huge");
if(w.size){ $("body").addClass(w.size) };
});
$( window ).resize(function() {
var w = checkWindowSize();
$("body").removeClass("tiny small medium large xlarge huge");
if(w.size){ $("body").addClass(w.size) };