Skip to content

Instantly share code, notes, and snippets.

REST API An back-end written in Express
Approximate Models to be made in MongoDB
User
username
password (hashed with bcrypt)
email
friend list (array of other user IDs)
album list (array of albums)
var client = new net.Socket();
client.connect(43, 'whois.iana.org', function(){
console.log('connected');
client.write('COM');
});
client.on('data', function(data){
console.log('Got:' + data);
client.destroy();
});
jQuery('#quote-gen').on('change', function(e){
var number = jQuery('input[name="panel-count"]').val();
var structure = jQuery('input[name="structure"]:checked').val();
var level = jQuery('input[name="level"]:checked').val();
var water = jQuery('input[name="water"]:checked').val();
var frequency = jQuery('input[name="frequency"]:checked').val();
var referrer = jQuery('input[name="referrer"]').val();
var details = jQuery('input[name="additional-details"]').val();
<form id="quote-gen" style="text-align: center; font-size: 1.2em; background: #e9e9e9; box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.2); padding: 2em">
<h1 style="text-align: center"> Get a quote now! </h1>
<label>How many panels do you have?</label>
<input type="number" name="panel-count" min="1" max="71"><br>
<br><label>What type of structure are your solar panels installed on?</label> <br>
<div style="text-align: left; display: inline-block; width: 30em">
<input type="radio" name="structure" value="home" id="home-panels"> Home Roof Top<br>
<input type="radio" name="structure" value="commercial"> Commercial Building Roof Top<br>
<input type="radio" name="structure" value="packing-covers"> Packing Covers<br>
import redis
def my_handler(message):
print 'MY HANDLER: ', message
r = redis.StrictRedis(host='localhost', port=6379, db=0);
p = r.pubsub()
p.subscribe(**{'globalInput:machine': my_handler})
import java.util.Scanner;
/**
*
* @author Anthony
*/
public class JavaApplication3 {
/**
* @param args the command line arguments
@Ntropish
Ntropish / GoalItem.vue
Created January 7, 2017 16:50
@click directly on <goal-item> doesn't work
<template>
<div class="goalItem">
<div>
{{goal.name}}
</div>
<slot></slot>
</div>
</template>
<script>
@Ntropish
Ntropish / command.npm
Created January 25, 2017 02:06
Vue CLI command to make a vue app skeleton
vue init webpack vue-todo
console.log('Seems correct!');
<html>
<head>
<!-- css, page title goes in here-->
</head>
<body>
<center>
<img id="sadface" src="http://balance3e.com/Images/sad.gif">
<br>
<button onclick="Changeimg(http://balance3e.com/Images/happy.gif);">Smile</button>
</center>