Skip to content

Instantly share code, notes, and snippets.

Avatar

Vincent Chu mephistoc

  • Taiwan
View GitHub Profile
@mephistoc
mephistoc / stamp.svg
Last active Sep 2, 2019
Align Texts to Center for Stamp in SVG
View stamp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mephistoc
mephistoc / round-robin_autoLookup.js
Created Dec 6, 2018
Trigger an Auto Lookup every 10 seconds in eForm #AgilePoint
View round-robin_autoLookup.js
/*
* Auto trigger an Auto Lookup every 10 seconds.
* 2018-Dec-07, Vincent Chu, AgilePoint Taiwan
*/
// Wire round-robin schedule on form load completed.
eFormEvents.onFormLoadComplete = function ()
{
setInterval(TriggerPIRAutoLookup, 10000);
}
@mephistoc
mephistoc / DHT11_Adafruit_sample.py
Created Dec 4, 2018
Example for capture and publish temperature and humidity value from DHT sensor on Raspberry Pi with Adafruit Python library.
View DHT11_Adafruit_sample.py
#!/usr/bin/python
import sys
import time
import Adafruit_DHT
import requests
import json
def main():
try:
while True:
@mephistoc
mephistoc / ethminer help.txt
Created Jun 29, 2017
ethminer 0.11.0 help
View ethminer help.txt
Usage ethminer [OPTIONS]
Options:
Work farming mode:
-F,--farm <url> Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)
-FF,-FO, --farm-failover, --stratum-failover <url> Failover getwork/stratum URL (default: disabled)
--farm-retries <n> Number of retries until switch to failover (default: 3)
-S, --stratum <host:port> Put into stratum mode with the stratum server at host:port
-FS, --failover-stratum <host:port> Failover stratum server at host:port
-O, --userpass <username.workername:password> Stratum login credentials
View Using Javascript Call AgilePoint API.html
<html>
<head>
<link rel="stylesheet" href="Styles/font-awesome.min.css">
<link rel="stylesheet" href="Styles/bootstrap.min.css">
<link rel="stylesheet" href="Styles/jquery.json-viewer.css">
<script src="/SharedResources/Javascript/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="/SharedResources/Javascript/ExternalPlugins/cookies.js"></script>
<script type="text/javascript" src="/SharedResources/Javascript/ExternalPlugins/underscore.js"></script>
<script type="text/javascript" src="/SharedResources/Javascript/APPlugins/sessionManager.js"></script>
View AgilePoint Session Manager Sample.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<!--<script src="/SharedResources/Javascript/APPlugins/filemanager.js"></script>-->
<script type="text/javascript">
document.write('<script type="text/javascript" src="/SharedResources/Javascript/APPlugins/filemanager.js?' + new Date().getTime() + '"><' + '/script>');
</script>
<script>
@mephistoc
mephistoc / CreateTestAccnt.ps1
Created Aug 9, 2016
Create a bunch of local user account for test or training on Windows with predefined un secure password.
View CreateTestAccnt.ps1
$userCnt = 1
$targetNumber = 60
do{
$currentCnt = $userCnt.ToString().PadLeft(2,"0")
$strCommand = "net user user$currentCnt `"p@ssw0rd`" /add"
iex $strCommand
#$strCommand
$userCnt++
}while($userCnt -le $targetNumber)
@mephistoc
mephistoc / 0_reuse_code.js
Created Mar 23, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.