Skip to content

Instantly share code, notes, and snippets.

@KeloCube
KeloCube / MFTTest.cpp
Last active March 29, 2025 10:11
Hardware H.264 encoding using Media Foundation Transforms
// MIT License
//
// Copyright 2018 Otto Itkonen
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
anonymous
anonymous / calibration.txt
Created October 13, 2017 10:08
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 4 5 6 8 9 10 11 13 14 15 16 18 19 20 21 23 24 25 26 28 29 30 31 33 34 35 36 38 39 40 41 43 44 45 46 48 49 50 51 53 54 55 56 58 59 60 61 63 64 65 66 68 69 70 71 73 74 75 76 78 79 80 81 83 84 85 86 88 89 90 91 93 94 95 96 98 99 100 101 103 104 105 106 108 109 110 111 113 114 115 116 118 119 120 121 123 124 125 126 128 129 130 131 133 134 135 136 138 139 140 141 143 144 145 146 148 149 150 151 153 154 155 156 158 159 160 161 163 164 165 166 168 169 170 171 173 174 175 176 178 179 180 181 183 184 185 186 188 189 190 191 193 194 195 196 198 199 200 201 203 204 205 206 208 209 210 211 213 214 215 216 218 219 220 221 223 224 225 226 228 229 230 231 233 234 235 236 238 239 240 241 243 244 245 246 248 249 250 251 253 254 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
13 14 15 16 17 17 18 19 20 20 21 22 23 24 24 25 26 27 27 28 29 30 31 31 32 33 34 34 35 36 37 38 38 39 40 41 41 42 43 44 45 45 46 47
@rambolee
rambolee / update-dnsmasq-from-gfwlist.py
Last active September 23, 2024 11:10
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active January 13, 2025 03:52
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@torpedoallen
torpedoallen / git-sub
Last active February 24, 2022 15:09
git sub
#!/bin/bash
# author: torpedoallen
# usage: find and replace
# how-to: put the file into your PATH like /usr/local/bin and make it executable.
# reminders: the default sed command will no longer work fine with -i argument, please replace with gnu-sed
if [ -z "$3" ]; then git grep -zl "$1" | xargs -0 sed -i "s/$1/$2/g"; else git grep -zl "$1" -- $3 | xargs -0 sed -i "s/$1/$2/g"; fi
;;;; Super top secret talk stuff nobody should ever see. Shhh.
(in-ns 'user)
(defmacro bench [& body]
`((re-find #"\"(.*)\"" (with-out-str (time (do ~@body)))) 1))
*ns*
(require 'clojure.walk)
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 5, 2025 02:20
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@brolewis
brolewis / schedulers.py
Last active March 6, 2022 22:53
A distributed job scheduler for Celery using ZooKeeper (via kazoo) to manage the locking.
'''Zookeeper-based Scheduler'''
## Standard Library
import cPickle # Store dictionary in ZooKeeper
import datetime # Time delta
import socket # Hostname
## Third Party
import celery # Current app
import celery.beat # Scheduler
import celery.utils.log # Get logger
import kazoo.client # ZooKeeper Client Library
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?