Skip to content

Instantly share code, notes, and snippets.

@sunkay
sunkay / data_preprocessing.ipynb
Created October 15, 2020 16:12
data_preprocessing.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sunkay
sunkay / regression-linear-simple.ipynb
Created October 15, 2020 16:10
Regression-linear-simple.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import React from 'react';
import expect from 'expect';
import {createRenderer} from 'react-addons-test-utils';
import expectJSX from 'expect-jsx';
expect.extend(expectJSX);
import Hello from './Hello.js';
describe('Hello World', () => {
it('works', () => {
import React from 'react';
class Hello extends React.Component {
render() {
return <span>Hello {this.props.name}</span>;
}
}
export default Hello;
<template name="menuItems">
<div class="slideout-menu">
<h3>Menu <a href="#" class="slideout-menu-toggle">×</a></h3>
<ul>
{{#if currentUser}}
<li>
<a href="{{pathFor 'deviceNew'}}">Add a Device</a>
</li>
{{/if}}
<li><a href="#">Home <i class="fa fa-angle-right"></i></a></li>
@sunkay
sunkay / gist:8507387
Created January 19, 2014 16:47
compare angular to meteor
//route
$routeProvider.when('/add', {templateUrl: 'partials/addDevice.html', controller: 'addDeviceController'});
//controller
.controller('addDeviceController', ['$scope', '$location', 'Devices',
function($scope, $location, Devices) {
$scope.add=true;
$scope.add = function(device){
if(!device) return;
'use strict';
/* jasmine specs for services go here */
describe('service', function() {
beforeEach(function(){
module('cotd.services');
module('ngResource');
});
'use strict';
/* jasmine specs for controllers go here */
/* Define all the services and controllers module, so they are accessable in your it's
*/
describe('controllers', function(){
beforeEach(function(){
module('cotd.controllers');
module('cotd.services');
@sunkay
sunkay / devices.js
Created May 20, 2013 13:49
node REST module - (does not yet use mongodb)
var devices = [
{id:0, name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"},
{id:1, name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""},
{id:2, name: "loaner-laptop-3", assetTag:"a43056", owner:"qa", desc:""},
{id:3, name: "android", assetTag:"a33756", owner:"dev", desc:"android2.4"},
{id:4, name: "galaxy tab", assetTag:"a53356", owner:"dev", desc:"android"},
{id:5, name: "loaner-laptop-2", assetTag:"a63556", owner:"qa", desc:""},
{id:6, name: "iphone", assetTag:"a73856", owner:"dev", desc:"iOS5"}
];
var express = require('express'),
items = require('./routes/devices.js');
var app = express();
// Read
app.get('/devices', items.findAll);
// View one device
app.get('/device/:id', items.findById);