Skip to content

Instantly share code, notes, and snippets.

View hashplus's full-sized avatar
🇨🇳

p(^-^q) hashplus

🇨🇳
  • CN
View GitHub Profile
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@hashplus
hashplus / app.js
Last active August 29, 2015 14:06 — forked from auser/app.js
angular.module('myApp',
['ngRoute', 'myApp.services', 'myApp.directives']
)
.config(function(AWSServiceProvider) {
AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role');
})
.config(function(StripeServiceProvider) {
StripeServiceProvider.setPublishableKey('pk_test_YOURKEY');
})
.config(function($routeProvider) {
<!doctype html>
<html ng-app="myApp">
<head>
<link rel="stylesheet" href="http://cdn.staticfile.org/foundation/5.3.0/css/foundation.css">
<script src="http://apps.bdimg.com/libs/angular.js/1.3.0-beta.8/angular.js"></script>
<style id="jsbin-css">
body {
background-color: #fff;
border-top: 5px solid #3399cc;
}
@hashplus
hashplus / index.html
Last active August 29, 2015 14:06 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-app="myApp">
<div ng-controller="MyController">
<input ng-model="to"
@hashplus
hashplus / crud.js
Created May 29, 2014 07:54
CouchCRUD
var http = require('http');
var qs = require('querystring');
var url = require('url');
var dbHost = '127.0.0.1';
var dbPort = 5984;
var deleteDb = function(res, dbpath) {
//var client = http.createClient(dbPort, dbHost);
//var request = client.request('DELETE', dbpath);
var request = http.request({
'port': dbPort,
// Constructor
var Interface = function(name, method) {
if (arguments.length != 2) {
throw new Error('error');
}
this.name = name;
this.methods = [];
for (var i = 0, len = methods.length; i < len; i++) {
if (typeof methods[i] !== 'string') {
throw 'error';
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
function Player(name){
this.pointer = 0;
this.name = name;
}
Player.prototype.play = function(){
this.points +=1;
mediator.played();
};