Skip to content

Instantly share code, notes, and snippets.

View nsmaciej's full-sized avatar
🙂
o awen pona

Maciej Goszczycki nsmaciej

🙂
o awen pona
View GitHub Profile
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@bellbind
bellbind / avcapture.m
Last active June 19, 2023 01:21
[objective-c][macosx]capturing image from webcam
// capture image from webcam(e.g. face time)
// for OSX 10.9 (use AVFoundation API instead of deprecated QTKit)
// clang -fobjc-arc -Wall -Wextra -pedantic avcapture.m
// -framework Cocoa -framework AVFoundation -framework CoreMedia
// -framework QuartzCore -o avcapture
#import <AVFoundation/AVFoundation.h>
#import <AppKit/AppKit.h>
@interface Capture : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
diff --git a/xmonad.hs b/xmonad.hs
index fbf7b5e..4c8cef6 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -23,6 +23,7 @@ import Control.Monad (filterM,liftM, join)
import Data.IORef
import Data.Monoid
import Data.List
+import Data.Bits
@alexkingorg
alexkingorg / spam-comment-script.txt
Created December 22, 2013 16:04
A spam comment script with replacement clauses intact - accidentally submitted in it's entirety to my site.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. Thanks.|
{It is|It's} {appropriate|perfect|the best} time to make some plans for the future and {it is|i
@hpique
hpique / OSX10.9-notifications.h
Created December 31, 2013 15:13
List of all public notifications in OSX 10.9 (or at least those whose constants are properly named).
// Accounts.framework/Headers/ACAccountStore.h
ACCOUNTS_EXTERN NSString * const ACAccountStoreDidChangeNotification NS_AVAILABLE(10_8, 5_0);
// AddressBook.framework/Headers/ABGlobals.h
extern NSString * const kABDatabaseChangedNotification;
extern NSString * const kABDatabaseChangedExternallyNotification;
// AddressBook.framework/Headers/ABPeoplePickerView.h
extern NSString * const ABPeoplePickerGroupSelectionDidChangeNotification AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
extern NSString * const ABPeoplePickerNameSelectionDidChangeNotification AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@rorhug
rorhug / q2.py
Created February 21, 2014 21:01
aipo 2013 q2
import math
def is_whole(x):
return x % 1 == 0
n = int(raw_input())
c_list = set()
c = 5
while len(c_list) < n:
#include <iostream>
using namespace std;
void doTheThing();
int main() {
int C;
cin >> C;
@rorhug
rorhug / s2.py
Created February 22, 2014 18:56
final 2014 q2
room_count = int(raw_input())
def tb(x):
return x == "*"
def get_room_in_bools():
height, width = [ int(y) for y in raw_input().split(" ") ]
return [ [ tb(x) for x in list(raw_input()) ] for y_axis in xrange(0, height) ]
room_grids = [get_room_in_bools() for x in xrange(0, room_count)]
#include <iostream>
using namespace std;
int main(){
int N;
int a, b, c;
cin>>N;