This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LED_GPIO 26 | |
#define PWM1_Ch 0 | |
#define PWM1_Res 10 | |
#define PWM1_Freq 50 | |
void setup() { | |
// put your setup code here, to run once: | |
ledcAttachPin(LED_GPIO, PWM1_Ch); | |
ledcSetup(PWM1_Ch, PWM1_Freq, PWM1_Res); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"path/filepath" | |
"regexp" | |
"strings" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ocservFront project main.go | |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"crypto/tls" | |
"fmt" | |
"io" | |
"io/ioutil" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ljbSpilter project main.go | |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"path/filepath" | |
"strconv" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('APP_PATH', dirname(__FILE__)); | |
define('DATA_FILE', APP_PATH. '/sms.htdata'); | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { //tasker提交 | |
if (!isset($_POST['c'])) { | |
die('Invalid Request!'); | |
} else { | |
$data = ''; | |
if (file_exists(DATA_FILE)) { //读入已有数据 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gitpull project main.go | |
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"os/exec" | |
"path/filepath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 获取本系统存放的目录 对应的url | |
* 当本系统部署在非站点根目录的时候 需要使用本函数获取系统根目录对应url | |
* 其后没有斜杠 | |
* @access public | |
* @return string | |
*/ | |
function get_baseurl() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 简单文件缓存 | |
* @author: horsley | |
* @version: 2013-11-04 | |
*/ | |
class Cache { | |
//内存缓存,跟磁盘缓存保持一致格式 | |
//消耗内存,但可减少一次请求内的磁盘io次数,并加速读取(命中时) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 简单自动部署 | |
* bitbucket POST hook http://horsley:anypassword@your_host/autodeploy.php | |
*/ | |
define('APP_PATH', dirname(__FILE__)); | |
if (php_sapi_name() != 'cli') { | |
if (!isset($_SERVER['PHP_AUTH_USER'])) { | |
header('WWW-Authenticate: Basic realm="My Realm"'); | |
header('HTTP/1.0 401 Unauthorized'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ScreenCloser project main.go | |
package main | |
import ( | |
"syscall" | |
"time" | |
) | |
const ( | |
SC_MONITORPOWER = 0xF170 |
NewerOlder