This file contains 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
#作业1 | |
(C)->"#{C} 摄氏度等于 #{C*1.8+32} 华氏度。" | |
(F)->"#{F} 华氏度等于 #{(F-32)/1.8} 摄氏度。" | |
#作业2 | |
[ B, A ] = [ A, B ] | |
#作业3 | |
SEC_IN_YEAR = 60*60*24*365 + 60*60*6 + 60*9 + 10 | |
SUPERMAN_CODELINE_IN_YEAR = SEC_IN_YEAR / 17 #SuperMan without rest |
This file contains 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
'use strict'; | |
module.exports = { | |
up: function (queryInterface, Sequelize) { | |
return queryInterface.sequelize.query('CREATE EXTENSION IF NOT EXISTS pgcrypto;'); | |
}, | |
down: function (queryInterface, Sequelize) { | |
// 这是大地终焉之处 | |
// return queryInterface.dropAllTables() |
This file contains 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
'use strict'; | |
/** | |
* Promised fs - fs.js | |
* Copyright(c) 2016 | |
* MIT Licensed | |
* | |
* @author Whale Mo (@whalemo) | |
*/ | |
const fs = require('fs'); | |
const Path = require('path'); |
This file contains 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
if(!$G._get("exists")) { | |
$G._set('exists', true); | |
var buttonInfos = { | |
'B_30':{startTime:120.77,avNum:'av6025863',text:'【东方原创编曲】幽雅的盛开,墨染的樱花 ~ Ordinary Remix',delay:8,x:5.5,y:224.5,width:497.5,height:60}, | |
'B_29':{startTime:128.85,avNum:'av6411176',text:'【东方MMD】咲夜的命运之夜・序章',delay:12,x:5.5,y:224.5,width:497.5,height:60}, | |
'B_28':{startTime:148.93,avNum:'av6392037',text:'【东方手书】若鹭姬的鱼卵三明治',delay:11,x:5.5,y:224.5,width:497.5,height:60}, | |
'B_27':{startTime:168.97,avNum:'av6326230',text:'【东方/幻想万华镜】花朵艳丽 终会散落',delay:11,x:5.5,y:224.5,width:497.5,height:60}, | |
'B_26':{startTime:189.06,avNum:'av6452468',text:'【東方MMD】和服版霊夢酱的極楽浄土【唯美向】',delay:11,x:5.5,y:224.5,width:497.5,height:60}, | |
'B_25':{startTime:209.1,avNum:'av3388284',text:'【囧星人】猴子也能懂的东方Project (修正版) #0~#6 未完',delay:7,x:5.5,y:224.5,width:497.5,height:60}, |
This file contains 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
Name: | |
"<style> | |
#scheme-Paradox .material-layout .mdl-card { | |
background-color: #111; | |
} | |
</style>" |
This file contains 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
bool ledBinkStatus = false; | |
//SoftwareSerial inSerial(0, 1); // RX, TX | |
void setup() { | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
// Keep SDA/D2 OUTPUT to LOW | |
pinMode(2, OUTPUT); | |
digitalWrite(2, LOW); | |
// start serial port (On USB) |
This file contains 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
#include <iostream> | |
#include <sstream> | |
#include <memory> | |
class A { | |
public: | |
A() { | |
std::ostringstream oss; | |
oss << "Constructor A@" << std::hex << (void *)this << "\n"; | |
std::cout << oss.str() << std::flush; |
This file contains 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
# This function will automate grep CMD($1) windows and set OPACITY($2). | |
transparent_windows() { | |
for i in $(pgrep -f $1); do | |
for j in $(/usr/bin/xdotool search --pid $i); do | |
xprop -id $j -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * $2 / 100))); | |
done | |
done | |
} | |
# Give vscode an alias. |
This file contains 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
#!/bin/bash | |
MAC="1234567890AB" | |
COOKIE_FILE="/tmp/router_cookie.txt" | |
function fetch_result() { | |
local R=$(curl -s -b "$COOKIE_FILE" 'http://192.168.1.1/cgi-bin/luci/admin/device/devInfo?type=0&_=0.'"$(date +\"%s\")" | jq '.count = {}| .curip = {} | .[] | select(.mac)') | |
date | |
echo "$R" | jq --raw-output '"\(.mac)\t\(.ip)\t\(.restrict)\t\(.upSpeed)\t\(.downSpeed)"' |
This file contains 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
#!/bin/bash | |
DESKTOP_WID=$(xdotool search --onlyvisible --classname "nemo-desktop" | head -n 1) | |
mpv --no-border --no-audio --osc=no --title="Desktop" --loop-playlist --wid="$DESKTOP_WID" "$@" |
OlderNewer