Skip to content

Instantly share code, notes, and snippets.

View Cougar's full-sized avatar
👨‍💻
I may be slow to respond.

Cougar

👨‍💻
I may be slow to respond.
View GitHub Profile
@Cougar
Cougar / WME-black-bg.user.js
Created October 6, 2012 17:09
WME black map background toggle
// ==UserScript==
// @name Change WME background to black
// @namespace http://version6.net/
// @description Add radio button to change background color
// @include https://world.waze.com/editor/*
// @include https://world.waze.com/map-editor/*
// @version 0.0.1
// ==/UserScript==
//-----------------------------------------------------------------------------------------------------------------------------------------
@Cougar
Cougar / ffmpeg-mix.txt
Created March 30, 2015 20:21
Mix audio tracks from two video files with different fps using ffmpeg
Input files are following:
file1.mkv:
Duration: 01:42:13.13, start: 0.000000, bitrate: 3735 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
Stream #0:2(kor): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
file2.mpeg:
Duration: 01:37:52.97, start: 0.780000, bitrate: 4153 kb/s
@Cougar
Cougar / gist:2c9cd3ee530d3e356265
Last active August 29, 2015 14:18
minecraft-wrapper protection.py plugin worinkg draft
import json, os, traceback
NAME = "protection"
AUTHOR = "C0ugar"
ID = "net.version6.minecraft.plugins.protection"
SUMMARY = "Protection commands"
DESCRIPTION = """Protection plugin."""
WEBSITE = ""
VERSION = (0, 1)
class Main:
@Cougar
Cougar / phant-vis.css
Created January 21, 2016 22:00 — forked from mplewis/phant-vis.css
Data logger visualization with Sparkfun's Phant and Highcharts. Licensed under the MIT License.
body {
margin-top: 40px;
margin-bottom: 40px;
}
.chart {
width: 100%;
height: 250px;
margin-top: 10px;
margin-bottom: 10px;
@Cougar
Cougar / syslog-splitter.pl
Created January 22, 2016 11:40
Split syslog file based on month field
#!/usr/bin/perl
my $m_old = "";
my $y = 0;
my $fd;
my $fn = "";
my %mon = (
Jan => '01',
@Cougar
Cougar / periodiccallback.py
Created January 31, 2016 21:29
Add run_now() method to tornado.ioloop.PeriodicCallback
import tornado.ioloop
class PeriodicCallback(tornado.ioloop.PeriodicCallback):
def run_now(self):
self.stop()
self._running = True
try:
return self.callback()
except Exception:
self.io_loop.handle_callback_exception(self.callback)
@Cougar
Cougar / udp-multi-socat.sh
Created March 22, 2016 13:41 — forked from mathieue/udp-multi-socat.sh
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@Cougar
Cougar / gist:0f8b4bc028df9856b7af6fad018bff2e
Created June 4, 2016 21:26
Add new subtitle to MKV file
ffmpeg -i source.mkv -f srt -i source.srt -map 0 -c:v copy -c:a copy -scodec copy -map 1 -scodec srt -metadata:s:s:10 language=est new.mkv
{
"success": true,
"itemTemplates": [
{
"templateId": "BADGE_BATTLE_ATTACK_WON",
"badgeSettings": {
"badgeType": "BADGE_BATTLE_ATTACK_WON",
"badgeRank": 4,
"targets": [
10,
Life is short, as everyone knows. When I was a kid I used to wonder about this. Is life actually short, or are we really complaining about its finiteness? Would we be just as likely to feel life was short if we lived 10 times as long?
Since there didn't seem any way to answer this question, I stopped wondering about it. Then I had kids. That gave me a way to answer the question, and the answer is that life actually is short.
Having kids showed me how to convert a continuous quantity, time, into discrete quantities. You only get 52 weekends with your 2 year old. If Christmas-as-magic lasts from say ages 3 to 10, you only get to watch your child experience it 8 times. And while it's impossible to say what is a lot or a little of a continuous quantity like time, 8 is not a lot of something. If you had a handful of 8 peanuts, or a shelf of 8 books to choose from, the quantity would definitely seem limited, no matter what your lifespan was.
Ok, so life actually is short. Does it make any difference to know that