Skip to content

Instantly share code, notes, and snippets.

View ciembor's full-sized avatar

Maciej Ciemborowicz ciembor

View GitHub Profile
@ciembor
ciembor / switch.py
Created January 22, 2013 11:08
Switching between Python 3 and 2 in a runtime
#!/usr/bin/env python
import sys, os
print(sys.version_info[:])
if sys.version_info[0] != 2:
sys.argv.insert(0, "python2")
os.execl("/usr/bin/env", "/usr/bin/env", *sys.argv)
@ciembor
ciembor / robot.js
Created December 4, 2012 06:25 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
@ciembor
ciembor / retotwe.py
Created November 24, 2012 00:09
Shows retweets to tweets ratio.
# -*- coding: utf-8 -*-
# https://github.com/ryanmcgrath/twython
from twython import Twython
# get your keys: https://dev.twitter.com/apps/new
t = Twython(app_key='jwh(...)PnQ',
app_secret='G2H(...)kSs',
oauth_token='284(...)Ytv',
oauth_token_secret='n8w(...)3Kk')
@ciembor
ciembor / gist:3615130
Created September 4, 2012 00:09
opłacalność optymalizacji
założenia:
mój czas jest wart tyle samo co czas osób, które go używają
dane:
delta_t - różnica czasu jednorazowego użycia kodu przed i po optymalizacji
x - prognozowana liczba użyć kodu
y - czas poświęcony na zoptymalizowanie kodu
z - prognozowana strata czasu podczas przyszłego rozwoju aplikacji
opłacalność = x * delta_t / (y + z)
@ciembor
ciembor / gist:3591685
Created September 1, 2012 23:56
Organizing time before an exam:)
#!/bin/bash
counter=1
while true; do
espeak -p10 -s160 "question ${counter}"
counter=`expr 1 + $counter`
sleep 600
done
@ciembor
ciembor / temperature.sh
Created July 14, 2012 14:19
This script protects the computer from being turned off after the temperature is too high. It sends warnings to the user and kills the most CPU intensive process.
#!/bin/bash
# This script protects the computer from being turned off
# after the temperature is too high. It sends warnings to
# the user and kills the most CPU intensive process.
#
# dependencies: awk, espeak, sensors
# author: Maciej Ciemborowicz
PERIOD=10
@ciembor
ciembor / gist:2759648
Created May 20, 2012 21:41
JS - Przestrzenie nazw
var namespaces = [
"jQuery",
"_",
"Backbone",
"Raphael",
"requirejs",
"ace",
"angular",
"Benchmark",
@ciembor
ciembor / tmks.py
Created April 14, 2012 18:52
Count scopes defined in Textmate color themes, than sort them and print
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import operator
try:
from collections import defaultdict
except Exception:
print("Failed to import defaultdict")
[ciembor@peace tmKeywordStats]$ ./tmks.py
54: comment
53: keyword
51: string
46: entity.other.inherited-class
45: support.function
44: storage
42: entity.other.attribute-name
39: constant
39: entity.name.tag
@ciembor
ciembor / gist:2324421
Created April 7, 2012 01:34
Great Grooveshark support:).
Maciej,
We've heard back from a few other users in Poland having the same issue. They said today they went to the site and it worked perfectly for them. Would you mind testing it out and letting us know if you continue to have any trouble?
Best,
Jessica - Community Developer
APR 06, 2012 | 07:30PM UTC
Maciej,
Thanks for getting back to us with this information. Our systems team is currently looking into this issue. As soon as they let me know what they've found I will get back to you.