Skip to content

Instantly share code, notes, and snippets.

@kopasetik
kopasetik / app.js
Created May 11, 2014 18:38
First try at the Ember Starter Kit
App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
App.IndexRoute = Ember.Route.extend({
model: function() {
return ['red', 'yellow', 'blue'];
},
@kopasetik
kopasetik / aggieTest.js
Last active August 29, 2015 14:01
Learnyounode
(function(){
args = process.argv;
args.shift();
args.shift();
var total = args.reduce(function(a,b){
return parseInt(a,10) + parseInt(b,10);
});
console.log(total);
})()
@kopasetik
kopasetik / asyncAttempt.js
Last active August 29, 2015 14:04
Trying to make this asynchronous
// create array to hold the values that the memory tiles will hold
var memory_values = [];
// create array for the locations of the tiles themselves
var memory_tile_ids = [];
// initialize array for the tiles flipped
var tiles_flipped = 0;
function onLinkedInLoad() {
IN.Event.on(IN, "auth", function() {
onLinkedInLogin();
@kopasetik
kopasetik / Responsive_Template1.html
Last active August 29, 2015 14:06
Sparkifly Gists
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Responsive Email Template</title>
<style type="text/css">
.ReadMsgBody {width: 100%; background-color: #ffffff;}
@kopasetik
kopasetik / SassMeister-input-HTML.html
Created October 5, 2014 03:14
Generated by SassMeister.com.
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
@kopasetik
kopasetik / OrdersCloseCommand.php
Created November 23, 2014 23:16
BaseCommand issue
<?php
class OrdersCloseCommand extends BaseCommand
{
public function run($args)
{
parent::run($args);
// var_dump(Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.assets')));exit;
@kopasetik
kopasetik / codejabber.js
Last active August 29, 2015 14:19
Node snippet on Cloud9
var
http = require("http"),
path = require("path"),
fs = require("fs"),
express = require('express');
var app = express();
var server = http.createServer(app);
app.get('/', function(res,req){
@kopasetik
kopasetik / index.jade
Created April 27, 2015 16:10
Basic Form
doctype html
html
head
title Basic Form
body
h1 This is the form.
form(action="/basic-form", method="post")
.form-name
label(for="name") Name
input(type="text", id="name", value="Enter your name", name="name")
@kopasetik
kopasetik / blogServer.js
Created May 9, 2015 19:30
A simple blog server that uses a JSON file as its data store
var
fs = require('fs'),
path = require('path'),
http = require('http'),
express = require('express'),
bodyParser = require('body-parser'),
multer = require('multer');
var app = express();
var server = http.createServer(app);
@kopasetik
kopasetik / duplicate.js
Last active August 29, 2015 14:21
duplicate the array
function duplicate(arr){
var newArr = arr;
if (!Array.isArray(newArr)) {
newArr = JSON.parse(newArr);
}
arr.forEach(function(x){
newArr.push(x);
});
return newArr;
}