Skip to content

Instantly share code, notes, and snippets.

View codelabspro's full-sized avatar
👩‍💻
Coding

CodeLabsPro codelabspro

👩‍💻
Coding
View GitHub Profile
@codelabspro
codelabspro / generator.py
Created May 17, 2017 21:56 — forked from NikitaKozlov/generator.py
Simple Java class generator
import sys, os, shutil
def generateClass(directory, classNumber, methodsPerClass, mainPackage):
className = "Foo" + str(classNumber)
filePath = os.path.join(directory, className + ".java")
with open(filePath,"w+") as f:
f.write("package " + mainPackage + "." + directory + ";\n")
f.write("public class " + className + " {\n")
for i in xrange(0, methodsPerClass):
f.write("public void foo" + str(i) + "(){\n")
@codelabspro
codelabspro / layout_2.ejs
Last active January 13, 2016 06:51
layout_2.ejs
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Brand</a>
</div>
@codelabspro
codelabspro / layout_1.ejs
Last active January 8, 2016 15:06
layout_1.ejs
<!DOCTYPE html>
<html>
<head>
<title>New Sails App</title>
<!-- Viewport mobile tag for sensible mobile support -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--
@codelabspro
codelabspro / new.ejs
Last active January 8, 2016 11:29
new.ejs
<form action="/session/create" method="POST" class="form-signin">
<h2 class="form-signin-heading">Please sign in</h2>
<% if (flash && flash.err) { %>
<ul class="alert alert-success">
<% Object.keys(flash.err).forEach(function(error) { %>
<li><%- JSON.stringify(flash.err[error]) %></li>
<% }) %>
</ul>
<% } %>
@codelabspro
codelabspro / SessionController_1.js
Last active January 8, 2016 11:22
SessionController_1.js
/**
* SessionController
*
* @description :: Server-side logic for managing sessions
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
'new': function(req, res) {
req.session.authenticated = true;
@codelabspro
codelabspro / layout.ejs
Last active January 8, 2016 08:00
layout.ejs
<div class="container">
<h3>User Administration</h3>
<table class='table'>
<tr>
<th></th>
<th>ID</th>
<th>Username</th>
<th>Title</th>
<th>Email</th>
<th></th>
@codelabspro
codelabspro / peter-thiels-cs183-startup-class-01-notes-essay.md
Created December 20, 2015 10:31 — forked from harperreed/peter-thiels-cs183-startup-class-01-notes-essay.md
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@codelabspro
codelabspro / user_edit.ejs
Created September 13, 2015 06:16
user_edit.ejs
<form action="/user/update/<%= user.id %>" method="POST" class="form-signin">
<h2> Hey, you're editing a user... </h2>
<input value="<%= user.username %>" name="username" type="text" class="form-control"/>
<input value="<%= user.title %>" name="title" type="text" class="form-control"/>
<input value="<%= user.email %>" name="email" type="text" class="form-control"/>
<input type="submit" value="Proceed" class="btn btn-lg btn-primary btn-block"/>
<input type="hidden" name="_csrf" value="<%= _csrf %>" />
</form>
@codelabspro
codelabspro / user_index.ejs
Last active September 13, 2015 06:13
user_index.ejs
<div class="container">
<h3>User Administration</h3>
<table class='table'>
<tr>
<th></th>
<th>ID</th>
<th>Username</th>
<th>Title</th>
<th>Email</th>
<th></th>
<div class='container'>
<h1><%= user.username %> </h1>
<% if (user.admin) { %>
<i class="fa fa-user-plus"></i>admin
<% } else { %>
<i class="fa fa-user"></i>user
<% } %>
<h3><%= user.title %> </h3>
<hr>
<h3>contact: <%= user.email %> </h3>