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
diff --git a/package.json b/package.json | |
index c0fc22b..6af8771 100644 | |
--- a/package.json | |
+++ b/package.json | |
@@ -25,6 +25,7 @@ | |
"sass": "^1.49.0", | |
"ts-loader": "^8.0.11", | |
"typescript": "^4.1.2", | |
+ "uglifyjs-webpack-plugin": "^2.2.0", | |
"urijs": "^1.19.7", |
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
/* https://theme.typora.io/doc/Write-Custom-Theme/ */ | |
@import "night.css"; | |
:root { | |
--text-color: #c8cfd6; | |
} | |
p { | |
color: #eeeeee; |
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
#!/bin/sh | |
# | |
# [plugin.metrics.puma_process] | |
# command = ["/usr/bin/mackerel-plugin-puma-process"] | |
if [ "$MACKEREL_AGENT_PLUGIN_META" = "1" ]; then | |
echo "# mackerel-agent-plugin" | |
cat << EOS | |
{ | |
"graphs": { |
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
require 'openssl' | |
key = OpenSSL::PKey::RSA.new(File.read('./server_key.pem')) | |
cert = OpenSSL::X509::Certificate.new(File.read('./server_crt.pem')) | |
cacert = OpenSSL::X509::Certificate.new(File.read('./cacert.pem')) | |
pass = 'Chi3Lee9' | |
# encode |
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
use std::time::{SystemTime, UNIX_EPOCH}; | |
pub fn epoch() -> u64 { | |
SystemTime::now() | |
.duration_since(UNIX_EPOCH) | |
.unwrap() | |
.as_secs() | |
} |
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
@spec gunzip(binary) :: {:ok, binary} | {:error, term} | |
def gunzip(data) when is_binary(data) do | |
try do | |
z = :zlib.open() | |
:ok = :zlib.inflateInit(z, 16 + 15) | |
result = | |
z | |
|> :zlib.inflate(data) | |
|> List.flatten() |
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 ruby | |
# frozen_string_literal: true | |
# roughly split & save the downloaded file. | |
class Main | |
require 'uri' | |
require 'net/http' | |
require 'fileutils' | |
require 'thwait' |
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 perl | |
use strict; | |
use warnings; | |
use Term::ANSIColor; | |
local $| = 1; | |
while (<STDIN>) { | |
my $line = $_; |
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 perl | |
use strict; | |
use warnings; | |
use Term::ANSIColor; | |
local $| = 1; | |
while (<STDIN>) { | |
my $line = $_; |
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
@doc """ | |
remove UTF-8's BOM | |
### Example | |
``` | |
iex> "\\uFEFFHello" |> MyProject.Util.remove_bom() | |
"Hello" | |
``` | |
""" |