Skip to content

Instantly share code, notes, and snippets.

@while0pass
while0pass / common.h
Created February 23, 2021 08:15 — forked from TatsuyaOGth/common.h
Detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor
#ifdef _WIN64
//define something for Windows (64-bit)
#elif _WIN32
//define something for Windows (32-bit)
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE && TARGET_IPHONE_SIMULATOR
// define something for simulator
#elif TARGET_OS_IPHONE
// define something for iphone
@while0pass
while0pass / stack trace
Created December 14, 2019 03:37
Stack trace for jinja2@django2
Internal Server Error: /
Traceback (most recent call last):
File "/home/nurono/.local/share/virtualenvs/sl-mOlTCCu_/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/nurono/.local/share/virtualenvs/sl-mOlTCCu_/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/nurono/.local/share/virtualenvs/sl-mOlTCCu_/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nurono/.local/share/virtualenvs/sl-mOlTCCu_/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
@while0pass
while0pass / dash-avc264 command lines
Created June 14, 2019 09:47 — forked from ddennedy/dash-avc264 command lines
Use ffmpeg and mp4box to prepare DASH-AVC/264 v1.0 VoD
See my DASH-IF presentation from October, 2014:
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/
1. encode multiple bitrates with keyframe alignment:
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012.

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@while0pass
while0pass / sendeth.py
Last active June 22, 2017 10:41 — forked from cslarsen/sendeth.py
One way of sending raw Ethernet packets in Python
"""Demonstrates how to construct and send raw Ethernet packets on the
network.
You probably need root privs to be able to bind to the network interface,
e.g.:
$ sudo python sendeth.py
"""
from socket import *
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"
$ ffmpeg -y -filter_complex 'amovie=/home/nurono/Desktop/kmvso.mp3, atrim=start=0:end=10, afade=t=in:st=0:d=2' n1.mp3
ffmpeg version N-40693-gf7bbe0f- http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 9 2014 02:20:35 with gcc 4.8 (Debian 4.8.3-10)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1
@while0pass
while0pass / _readme.md
Last active August 29, 2015 14:06 — forked from shime/_readme.md

Having trouble installing the latest stable version of tmux?

Save yourself some time and run this little fellow!

Prerequisities

  • gcc
  • wget
@while0pass
while0pass / inConsoleFindCircularRefs.js
Last active December 26, 2015 08:19
Find circular references in an object to be json-strinified.
ZZZ = document.createElement('script');
ZZZ.src = '//yandex.st/dojo/1.9.1/dojo/dojo.js';
document.body.appendChild(ZZZ);
// In firebug one can use ``include`` command instead:
// include('//yandex.st/dojo/1.9.1/dojo/dojo.js');
require(["dojox/json/ref"], function(){
window.ZZZ = dojox.json.ref.toJson(ko.toJS(objectWithCircularReferences));
});
@while0pass
while0pass / dabblet.css
Created April 15, 2013 08:14 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}