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
#!/usr/bin/env bash | |
# Usage: | |
# dl.sh "https://www.youtube.com/watch?v=ec-IgIkEkmA" | |
# | |
# 限制檔案名稱長度,主要是為了避開 FAT、NTFS 的限制 | |
/path/to/yt-dlp/yt-dlp.sh \ | |
-o '%(title).150s-%(id)s.%(ext)s' \ | |
-f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" \ |
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 | |
error_reporting(E_ALL); | |
echo "connection to whois.twnic.net.tw\n"; | |
$address = gethostbyname('whois.iana.org.'); | |
$fp = @fsockopen($address, 43, $errno, $errstr, 5) or die("Socket Error " . $errno . " - " . $errstr); | |
stream_set_blocking($fp, true); |
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
// ==UserScript== | |
// @name Redirect Mobile Mediawiki to Desktop URL | |
// @namespace http://blog.zeroplex.tw/ | |
// @version 0.1 | |
// @description If Mediawiki opened in mobile page, redirect it to general page | |
// @author zeroplex | |
// @match https://*.m.wikipedia.org/* | |
// @grant none | |
// ==/UserScript== |
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
#!/usr/bin/env bash | |
# usage: | |
# linodecreate NUM | |
# | |
# NUM is the number of node you want to create | |
genpassword() { | |
PASS=$( tr -dc A-Za-z0-9 </dev/urandom | head -c 5 | tr '[:upper:]' '[:lower:]' ) | |
echo -n "prefix-$PASS" |
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 | |
use Illuminate\Testing\TestResponse; | |
use Symfony\Component\HttpFoundation\Request as SymfonyRequest; | |
trait ApiTokenRequestTrait | |
{ | |
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null, $headers = []) | |
{ | |
$symfonyRequest = SymfonyRequest::create( |
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
<scheme name="Darcula" version="142" parent_scheme="Darcula"> | |
<metaInfo> | |
<property name="created">2022-02-18T21:35:09</property> | |
<property name="ide">PhpStorm</property> | |
<property name="ideVersion">2021.3.2.0.0</property> | |
<property name="modified">2022-02-18T21:35:29</property> | |
<property name="originalScheme">_@user_Darcula</property> | |
</metaInfo> | |
<attributes> | |
<option name="DEFAULT_DOC_COMMENT"> |
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 | |
/** | |
* This file is orginzed from @FDisk from StackOverflow | |
* @see https://stackoverflow.com/a/28608156/8681141 | |
*/ | |
namespace App\Http\Middleware; | |
use Closure; |
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 | |
function getServerKey(string $key): string | |
{ | |
if (array_key_exists($key, $_SERVER)) { | |
return $_SERVER[$key]; | |
} | |
return ''; | |
} | |
$orderedKey = [ |
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
@import url(../../../stylesheets/application.css); | |
/* A1 theme version 2.0.0 by Kirill Bezrukov www.redmineup.com */ | |
#header { | |
background: #394956; | |
min-height: 5em; | |
padding: 0px; | |
min-height: initial; |
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
var webduino = require('webduino-js'); | |
board = new webduino.WebArduino('Ge8pn'); | |
board.on('ready', function (board) { | |
var pin = new webduino.core.Pin(board, 10, Pin.DOUT); | |
board.systemReset(); | |
board.samplingInterval = 250; | |
var replay = new webduino.module.Relay(board, 10); |