Skip to content

Instantly share code, notes, and snippets.

View superzazu's full-sized avatar
🐷

superzazu superzazu

🐷
View GitHub Profile
@lillesvin
lillesvin / bytescramble.rb
Last active September 20, 2015 07:27
Data bending is fun!
#!/usr/bin/env ruby
##
# ByteScramble
#
# Copyright 2015 Anders K. Madsen <lillesvin@gmail.com>
# Licence: MIT <https://opensource.org/licenses/MIT>
#
# Description:
# ------------
@pudquick
pudquick / notify.py
Last active September 3, 2023 16:51
Notification in pyobjc
# Banner-style (default)
from Foundation import NSUserNotification, NSUserNotificationCenter
def notify(title, subtitle, text):
notification = NSUserNotification.alloc().init()
notification.setTitle_(str(title))
notification.setSubtitle_(str(subtitle))
notification.setInformativeText_(str(text))
notification.setSoundName_("NSUserNotificationDefaultSoundName")
NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification)
@kaloprominat
kaloprominat / python: simple pyobjc app example
Created July 29, 2013 15:36
python: simple pyobjc app example
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
# We need to import the relvant object definitions from PyObjC
from AppKit import *
from PyObjCTools import AppHelper
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played