Skip to content

Instantly share code, notes, and snippets.

View lotosbin's full-sized avatar
🏠
Working from home

bin^2 lotosbin

🏠
Working from home
View GitHub Profile
@lotosbin
lotosbin / eslint-changed.sh
Created August 26, 2016 02:55 — forked from kentcdodds/eslint-changed.sh
Shell script to lint only changed files to be used as a githook (specific to my project)
#!/usr/bin/env bash
set -e
# allow being run from somewhere other than the git rootdir
gitroot=$(git rev-parse --show-cdup)
# default gitroot to . if we're already at the rootdir
gitroot=${gitroot:-.};
nm_bin=$gitroot/node_modules/.bin
@lotosbin
lotosbin / linc.sh
Created August 26, 2016 02:50 — forked from dozoisch/linc.sh
Run Lint Only on Changed files
git diff -z --name-only --diff-filter=ACMRTUB `git merge-base HEAD master` | xargs -0 eslint
/**************************************************************
24bit HX711参考驱动程序
在C中调用:
extern unsigned long ReadAD(void); . .
unsigned long data;
data=ReadAD(); . .
-------------------------------------------------------------*/
sbit ADDO = P1^5;
sbit ADSK = P0^0;
unsigned long ReadCount(void){
@lotosbin
lotosbin / Events.cs
Last active August 29, 2015 14:08 — forked from wmiller/Events.cs
using System.Collections;
using System.Collections.Generic;
public class GameEvent
{
}
public class Events
{
static Events instanceInternal = null;

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"

@lotosbin
lotosbin / seajs.html
Created December 6, 2013 09:14
javascript:html:seajs
<!DOCTYPE HTML>
<html>
<head>
<title></title>
</head>
<body>
<script>
// seajs 的简单配置
seajs.config({
base: "./sea-modules/",
@lotosbin
lotosbin / html5.html
Created December 6, 2013 09:06
Html5:tempalte
<!DOCTYPE HTML>
<html>
<head>
<title></title>
</head>
<body></body>
</html>
/**
* jQuery MD5 hash algorithm function
*
* <code>
* Calculate the md5 hash of a String
* String $.md5 ( String str )
* </code>
*
* Calculates the MD5 hash of str using the » RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
* MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data.
// file upload controller
function FileUploadCtrl($scope) {
//when upload finished
$scope.uploadFinished=function(e,data){
console.log(e)
console.log(data)
};
@lotosbin
lotosbin / app.js
Last active December 21, 2015 16:18 — forked from eperedo/app.js
use module
var app = angular.module('plunker', ['LaddaDirective']);
app.controller('MainCtrl', function($scope, $timeout) {
$scope.save = function(){
$scope.loading = true;
$timeout(function(){
$scope.loading = false;
}, 3000);
};