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
@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"

/**
* 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);
};
'use strict';
/**
* ui-ladda
*
* To use, simply use normal Ladda classes and attributes and pass a model to ui-ladda. You can
* use truthy or falsey values, or pass decimals from 0 to 1 to show the progress bar animation.
*
*
* @param uiLadda (mixed): Sets wether or not to show the ladda loading
#!/bin/bash
# See for eg
# http://stackoverflow.com/questions/4526910/rename-a-git-submodule;
# an important point seems to be to avoiding the trailing '/' when
# calling 'add' in the new location.
# Also, note that the name ([submodule = "name"]) in the .gitmodules
# file can be anything; it's just used to map to the corresponding
# .git/config entry.
@lotosbin
lotosbin / hosts.ps1
Created December 20, 2012 15:08 — forked from markembling/hosts.ps1
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "$env:SystemRoot"+"\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {