Skip to content

Instantly share code, notes, and snippets.

View CrashLaker's full-sized avatar
💭
🌌 Wired

Carlos Aguni • 顾宁 CrashLaker

💭
🌌 Wired
View GitHub Profile
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="//unpkg.com/d3@5.15.1"></script>
</head>
<body>
<svg></svg>
gistup
@CrashLaker
CrashLaker / index.html
Last active March 3, 2020 04:55
rooms schedule timeline chart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
.zoom {
import datetime
import pytz
timestamp = 1556668800.0
date = datetime.datetime.utcfromtimestamp(timestamp)
print(date) # 2019-05-01 00:00:00
# Applying timezone without converting it
date_utc = pytz.utc.localize(date)
print(date_utc.strftime(fmt)) # 2019-05-01 00:00:00 UTC+0000
import datetime
import pytz
timestamp = 1556668800.0
date = datetime.datetime.utcfromtimestamp(timestamp)
print(date) # 2019-05-01 00:00:00
# Applying timezone without converting it
date_sp = pytz.timezone("America/Sao_Paulo").localize(date)
print(date_sp.strftime(fmt)) # 2019-05-01 00:00:00 -03-0300
import datetime
timestamp = 1556668800.0
date = datetime.datetime.utcfromtimestamp(timestamp)
print(date) # 2019-05-01 00:00:00
@CrashLaker
CrashLaker / python-dateing-1.py
Last active May 5, 2019 02:47
python dateing-1
import datetime
import time
date = datetime.datetime(2019,5,1) # date object
print(date) # 2019-05-01 00:00:00
ts = time.mktime(date.timetuple()) # timestamp in seconds
print(ts) # 1556668800.0
#!/bin/bash
#$2 .mp3
ffmpeg -i $1 -acodec libmp3lame -aq 4 $2
#https://ubuntuforums.org/showthread.php?t=1493682
@CrashLaker
CrashLaker / mergeMp4
Last active April 30, 2018 15:52
Merge mp4 video files using bash + ffmpeg
#!/bin/bash
# $1 = filename
rm -f ${1}.mp4
a=1;for file in `ls ${1}*.mp4`; do ffmpeg -i $file -c copy -bsf:v h264_mp4toannexb -f mpegts tmpfile${a}.ts; a=$((a+1)); done
ffmpeg -i "concat:`ls tmpfile*.ts | paste -s -d\"|\"`" -c copy -bsf:a aac_adtstoasc ${1}.mp4