Skip to content

Instantly share code, notes, and snippets.

@mason276752
mason276752 / index.html
Created April 17, 2018 06:29 — forked from jerrybendy/ index.html
一个使用 HTML5 录音的例子(网上看到的,收藏下)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div>
<audio controls autoplay></audio>
<input onclick="startRecording()" type="button" value="录音" />
@mason276752
mason276752 / rxjsOperator.js
Last active March 15, 2018 03:39
rxjs operator
function log() {
return Rx.Observable.create((observer) => {
return this.subscribe(
(value) => {
console.log(value);
try {
observer.next(value);
} catch (e) {
observer.error(e);
}
@mason276752
mason276752 / ibm_fabric.sh
Created January 12, 2018 12:42
ibm_fabric.sh
#!/bin/sh
set -e
echo
echo "#################################################################"
echo "####### Generating cryptographic material ##########"
echo "#################################################################"
PROJPATH=$(pwd)
CLIPATH=$PROJPATH/cli/peers
ORDERERS=$CLIPATH/ordererOrganizations
@mason276752
mason276752 / checkType.js
Last active December 27, 2017 07:40
check type
let typeOf = (value) => {
let result = Object.prototype.toString.call(value).slice(8, -1);
if (result === 'Number') {
switch (value) {
case Infinity:
return 'Infinity';
case -Infinity:
return '-Infinity';
case value:
return 'Number';
@mason276752
mason276752 / jsnote.js
Created September 24, 2017 11:44
你平常不會用到的js
str1 = "http://www.google.tw/search?q=中文";
obj = {
get a(){return '1';},
set b(value){this.c = value;},
c:1
};
class Cls{
constructor(name){
console.log("hello",name);
if (typeof(new.target)==='function')
@mason276752
mason276752 / reload_urlconf.py
Created May 7, 2017 19:18 — forked from FZambia/reload_urlconf.py
reload django urlconf
#python manage.py runserver --noreload
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.http import HttpResponse
import sys
def reload_urls(request, urlconf=None):
if urlconf is None:
urlconf = settings.ROOT_URLCONF