Skip to content

Instantly share code, notes, and snippets.

View YANOUSHek's full-sized avatar

Janusz Bossy YANOUSHek

View GitHub Profile
@YANOUSHek
YANOUSHek / brew --config
Created May 11, 2012 17:45
gtk+ install error
HOMEBREW_VERSION: 0.9
HEAD: b73b40fa1da84411cd7089116da1b20d55f0208d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
@YANOUSHek
YANOUSHek / pyc
Created October 27, 2011 13:46
pyc
Server 1
========
[11] root at fotoportal in ~/Dropbox/dotfiles/hgextensions
$ python --version
Python 2.5.2
[11] root at fotoportal in ~/Dropbox/dotfiles/hgextensions
$ rm *pyc
@YANOUSHek
YANOUSHek / uploader.m
Created October 18, 2011 23:36
Cocoa uploader for LetsCrate
NSURL *url = [NSURL URLWithString:@"https://api.letscrate.com/1/files/upload.json"];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
[req setHTTPMethod:@"POST"];
NSString* authString = [[[NSString stringWithFormat:@"%@:%@", @"LOGIN", @"PASSWORD"] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding];
authString = [NSString stringWithFormat: @"Basic %@", authString];
[req setValue:authString forHTTPHeaderField:@"Authorization"];
NSString *boundary = @"0xKhTmLbOuNdArY";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
@YANOUSHek
YANOUSHek / t.py.diff
Created August 17, 2011 14:24
t sort by task's text
--- a/t.py Mon May 09 21:22:15 2011 -0400
+++ b/t.py Wed Aug 17 16:23:46 2011 +0200
@@ -202,7 +202,7 @@
tasks[task_id]['prefix'] = prefix
plen = max(map(lambda t: len(t[label]), tasks.values())) if tasks else 0
- for _, task in sorted(tasks.items()):
+ for _, task in sorted(tasks.items(), key=lambda t: t[1]['text'].lower()):
if grep.lower() in task['text'].lower():
p = '%s - ' % task[label].ljust(plen) if not quiet else ''
@YANOUSHek
YANOUSHek / GooglePlus.js
Created July 14, 2011 15:32
Fluid icon badge for Google+
window.fluid.dockBadge = "";
var count = 0;
setInterval(badge, 5000);
function badge() {
var el = document.getElementById("gbi1");
if (el == null) {
if (count++ > 5) {
window.fluid.dockBadge = "!";