Skip to content

Instantly share code, notes, and snippets.

@Med116
Med116 / shopping_car.js
Created April 17, 2014 21:31
shopping cart code for backbone.js
var AppRouter = Backbone.Router.extend({
routes:{
"products.html":"products"
}
});
Backbone.history.start();
var NavView = Backbone.View.extend({
el:"nav",
render: function(){
var template_html = jQuery("#nav_template").html();
@Med116
Med116 / base_tag.js
Last active August 29, 2015 14:00
js base tag
/*
* ZML: Zero Markup Language dot js
* This script defines BasrTag function that
* parents all html tags. "<div>" being the default tag
* Author: Mark Davis
*/
var Zm = {
Utils : {
appendToBody: function(zm_content){
@Med116
Med116 / layout.js
Created May 2, 2014 20:12
little router and server for node
module.exports = function(title, content){
var zm = require("zm").zm;
var html = new zm.BaseTag().tag("html");
var head = new zm.BaseTag().tag("head");
head.addContent(new zm.BaseTag().tag("link").setAttr("href", "style.css").setAttr("type", "text/css").setAttr("rel","stylesheet"));
html.addContent(head);
var body = new zm.BaseTag().tag("body");
// here is where content is injected
body.akon(new zm.Div(content).setAttr("id","main"));
@Med116
Med116 / ajax.js
Created May 7, 2014 18:23
ajax javascript get
function getAjax(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
@Med116
Med116 / mailgunner.js
Created July 22, 2014 20:30
sends email via mailgun api
var MailGun = function(configObj){
var mailgunKey = process.env.MAILGUN_KEY || configObj.apiKey;
this.auth = "api:" + mailgunKey;
this.hostname = "api.mailgun.net";
this.toArray = [];
this.text = "default text";
this.html = "";
this.subject = configObj.subject || "No Subject";
this.from = configObj.from || "";
this.domain = configObj.domain;
@Med116
Med116 / array2groupedobject.js
Created July 22, 2014 21:13
takes in ar array of strings, and returns a grouped object
module.exports = function(arr,callback){
var groupByObj = {};
if(arr.length == 0){
callback(groupByObj);
}
var count = 0;
arr.forEach(function(val){
@Med116
Med116 / pebbe time colors
Created June 26, 2015 19:34
pebble colors java code
var color_picker_colors = {
"#AAFFAA": {
"dist": 25.45584412271571,
"closest": {
"url": "http://en.wikipedia.org/wiki/Spring_green_(color)#Mint_green",
"r": 152,
"b": 152,
"name": "Mint green",
"g": 255
},
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
@Component({
selector: 'app-one',
template: `<ol>
<li *ngFor="let planet of planets$ | async"> {{ planet }} </li>
</ol>
`,
styleUrls: ['./one.component.css']
@Med116
Med116 / Col
Last active August 21, 2019 02:42
java jx git gui code Main
package sample;
public class DBColumn implements DBItem {
private String columnName;
private String columnTypeName;
private int columnType;
private boolean primaryKey;
{
"name": "dexergon64",
"vendorProductId": 808452096,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_Q",
"KC_W",
"KC_E",