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
// cc omri.c -shared -o omri.so; LD_PRELOAD=`pwd`/omri.so ... | |
#include <errno.h> | |
int isatty(int unused) { | |
errno = ENOTTY; | |
return 0; | |
} | |
// omri pls |
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/bash | |
ALB="$(ffprobe "$1" 2>&1 | grep album | cut -d: -f2 | sed -re \ | |
's/^\s+// | |
s/\s+$// | |
s/\s+\([^()]+\)$//' )" | |
ffmpeg -i "$1" -c copy -metadata album="$ALB" "$(echo "$1" | sed 's/_$//')" |
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 threads; | |
use sigtrap qw(die INT QUIT); | |
use File::Basename; | |
use File::Path qw/make_path/; | |
use Data::Dumper; | |
use POSIX; |
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
#include <iostream> | |
template < typename CT, typename TT = std::char_traits<CT> > | |
class devnull_streambuf : public std::basic_streambuf<CT, TT> { | |
protected: | |
// null | |
typename std::basic_streambuf<CT,TT>::int_type | |
overflow(typename std::basic_streambuf<CT,TT>::int_type c = TT::eof()); | |
}; |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
class Program { | |
static readonly Dictionary<char, string> morseCodes | |
= new Dictionary<char, string> { | |
// ITU-R M.1677-1 1.1.1 | |
{'a', ".-"}, {'i', ".."}, {'r', ".-."}, | |
{'b', "-..."}, {'j', ".---"}, {'s', "..."}, |
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
#include <iostream> | |
#include <stack> | |
#include <type_traits> | |
#include <boost/tti/has_member_function.hpp> | |
BOOST_TTI_HAS_MEMBER_FUNCTION(push) | |
BOOST_TTI_HAS_MEMBER_FUNCTION(pop) | |
BOOST_TTI_HAS_MEMBER_FUNCTION(top) | |
template <typename C> |
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
#if __cplusplus < 201103L | |
#error "missing -std=c++11" | |
#endif | |
#include <utility> | |
#include <string> | |
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <list> |