Skip to content

Instantly share code, notes, and snippets.

@Marneus68
Marneus68 / rm_r.c
Created May 1, 2012
Recursive file and directory removal in C
View rm_r.c
int rm_r(const char* e_path)
{
DIR *dir = opendir(e_path);
struct dirent *ent;
if (dir == NULL)
/* error while opening the directory */
return -1;
/* DA MAGICKS */
View a2dp_sink_ubuntu_linux.md

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

@Marneus68
Marneus68 / gist:5388522
Created Apr 15, 2013
Put a clock at the top right of your terminal sesion.
View gist:5388522
while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
View gksudo equivalent for Mac OS X
# A gksudo equivalent for Mac OS X
/usr/bin/osascript -e 'do shell script "make install" with administrator privileges'
View ClosureTest
using UnityEngine;
using System.Collections.Generic;
public class ClosureTest : MonoBehaviour {
public delegate void TestAction();
void Start () {
Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>() {
{ "Foo" , new List<string>() { "Goo", "Hoo", "Ioo" } },
View gist:015429675e7e616e6828
#
# UnityYAMLMerge fallback file
#
# Modify the next two lines if scene or prefab files should fallback
# on other that the default fallbacks listed below.
#
# %l is replaced with the path of you local version
# %r is replaced with the path of the incoming remote version
# %b is replaced with the common base version
View build_textual_mac_os_x.rc
#!/usr/bin/env rc
dir=$home/Desktop
cd /tmp
printf 'Cloning Textual... '
git clone -q 'https://github.com/Codeux-Software/Textual.git'
echo Done!
printf 'Cloning submodules... '
cd Textual
View iOS app transport security - info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
@Marneus68
Marneus68 / pacaur_install.sh
Created Apr 26, 2016 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
View pacaur_install.sh
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!
View Army List
<html>
<head>
<meta name="viewport" content="width=670">
<style>
body.battlescribe {
margin: 0px;
padding: 0px;
border-width: 0px;
}
You can’t perform that action at this time.