Skip to content

Instantly share code, notes, and snippets.

View ePirat's full-sized avatar

Marvin Scholz ePirat

View GitHub Profile
@ePirat
ePirat / CodeStyle.md
Last active August 29, 2015 14:07
C Coding Style proposal for Icecast

C Coding Style

Proposal for Icecast

Formatting

Indent with (4) spaces, no tabs.
A Line Should Not Exceed 80 Characters.

Brace Placement

All if, while, for and do statements should either have braces or be on a single line. Do not put parens next to keywords. Put a space between.

anonymous
anonymous / .css
Created February 5, 2016 16:40
abbr[title],
acronym[title],
dfn[title] {
border-bottom: 1px dotted #000;
}
@supports (text-decoration: dotted underline) {
abbr[title],
acronym[title],
dfn[title] {
text-decoration: dotted underline;
#!/bin/bash
ROOT=output
CC=x86_64-linux-musl-g++
CFLAGS="
-nostdinc
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/x86_64-linux-musl
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/backward
-isystem $ROOT/x86_64-linux-musl/include/
@catlan
catlan / Document.m
Last active August 7, 2019 21:31
Pages.app like moveToURL:completionHandler: impl. NSIsRelatedItemType key in Info.plist is required
- (void)moveToURL:(NSURL *)url completionHandler:(void (^ __nullable)(NSError * __nullable))completionHandler
{
NSError *error = nil;
NSURL *adjustedURL = nil;
if (![[url pathExtension] isEqualToString:@"testextension"]) {
adjustedURL = [url URLByAppendingPathExtension:@"testextension"];
}
@Akemi
Akemi / remote.swift
Created July 28, 2019 09:55
MPRemoteCommandCenter Test
// call like "swift remote.swift"
import MediaPlayer
let centre = MPRemoteCommandCenter.shared()
let handler: (String) -> ((MPRemoteCommandEvent) -> (MPRemoteCommandHandlerStatus)) = { (name) in
return { (event) -> MPRemoteCommandHandlerStatus in
print("\(name)")
return .success
}
@Drakulix
Drakulix / mingw-w64-3.10-osx10.9.sh
Last active January 9, 2020 11:49
Script to install a Mingw-w64 Cross-Compiler Suite on Mac OS X 10.9
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install gcc48
#!/bin/bash
MINIDUMP_PATH="${1}"
MINIDUMP_STACKWALK=$(which minidump_stackwalk)
if [ -z "$MINIDUMP_STACKWALK" ]; then
if [ -f "$HOME/.mozbuild/minidump_stackwalk/minidump_stackwalk" ]; then
MINIDUMP_STACKWALK="$HOME/.mozbuild/minidump_stackwalk/minidump_stackwalk"
else
printf "You need the minidump_stackwalk executable in your PATH or under ~/.mozbuild in order to run this script\n"
exit 1
@Odie
Odie / gist:e26bc299bfc1f020e636
Created October 9, 2014 12:10
Parse user friendly time duration string in Swift
import UIKit
extension NSDateComponents {
subscript(unit: String) -> Int {
get {
switch unit{
case "month":
return self.month
case "day":
return self.day

Compile for Windows (64bit)

Pull the VideoLAN Docker container and run it in interactive mode with bash:

(The -v ~/docker:/root/shared maps /root/shared in the container to ~/docker on your machine to easily obtain the build results, so make sure ~/docker exists.)

docker pull registry.videolan.org:5000/vlc-debian-win64
docker run -v ~/docker:/root/shared -it registry.videolan.org:5000/vlc-debian-win64 /bin/bash
@Treeki
Treeki / odeus.py
Last active September 24, 2022 00:15
# runs under Python 2 (yes, I know...)
# required modules: pip install unicorn pefile
# this code is made available under the MIT license, as follows:
# Copyright (c) 2018 Ash Wolf
# 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