Skip to content

Instantly share code, notes, and snippets.

View romanz's full-sized avatar
💭
I may be slow to respond.

Roman Zeyde romanz

💭
I may be slow to respond.
View GitHub Profile
@romanz
romanz / wifi.js
Created January 8, 2012 14:56
WiFi switch bookmarklet for D-link DIR-300 wireless router
javascript:(function(){
location.assign("http://192.168.0.1/bsc_wlan.php");
document.getElementById("enable").checked = !document.getElementById("enable").checked;
check();
})()
@romanz
romanz / makeEqn.js
Created November 20, 2011 16:52
TexWorks Script - Insert eqnarray environment.
// TeXworksScript
// Title: Make Equations
// Shortcut: Ctrl+Shift+Q
// Description: Create new equation array.
// Author: Roman Zeyde
// Version: 0.1
// Date: 2011-11-20
// Script-Type: standalone
// Context: TeXDocument
@romanz
romanz / gist:1306023
Created October 22, 2011 13:41
conkyrc
# Generated with Conky Wizard
# Copyright (C) 2010 José David Abad García
# GPL Version 3
#
# WARNING! All changes made in this file will be lost if the program runs again!
# Default Fonts
use_xft yes
xftfont Ubuntu:size=10
override_utf8_locale yes
@romanz
romanz / weather.py
Created October 22, 2011 13:38
Extract weather information (for conky)
#!/usr/bin/python
# Usage for .conkyrc:
# ${execi 15 ~/weather.py 40155}
import sys
import re
from urllib2 import urlopen
url = 'http://rss.wunderground.com/auto/rss_full/global/stations/'
station_id, = sys.argv[1:]
@romanz
romanz / git-rename.sh
Created October 11, 2011 18:03
Fix author/commiter information in GIT repository
git filter-branch -f --env-filter "export GIT_AUTHOR_NAME='Roman Zeyde'; export GIT_COMMITTER_NAME='Roman Zeyde'; export GIT_AUTHOR_EMAIL='roman.zeyde@gmail.com'; export GIT_COMMITTER_EMAIL='roman.zeyde@gmail.com'" HEAD
@romanz
romanz / attr.py
Created October 4, 2011 10:15
Attribute dictionary
class Dict(dict):
''' Extends Python dictionary for attribute access, so d.foo is the same as d['foo']. '''
def __setattr__(self, name, val):
dict.__setitem__(self, name, val)
def __getattr__(self, name):
return dict.__getitem__(self, name)
def __delattr__(self, name):
return dict.__delitem__(self, name)
@romanz
romanz / gist:1027096
Created June 15, 2011 13:34
MATLAB profiling API demo
profile('on');
%%%%%%%%%%%%%%%%%%%
% Code to profile %
%%%%%%%%%%%%%%%%%%%
profile('off');
prof = profile('info');
profview(0, prof);
@romanz
romanz / gist:1027087
Created June 15, 2011 13:28
Git commit information from MATLAB
function v = version()
[~, version] = git('--no-pager', 'log -n1 --format=format:"%h (%ci)"');
@romanz
romanz / gist:968200
Created May 12, 2011 08:56
MATLAB Git wrapper (for Linux)
function [status, result] = git(varargin)
cmd = 'unset LD_LIBRARY_PATH; git --no-pager';
for i = 1:numel(varargin)
cmd = [cmd ' ' varargin{i}];
end
switch nargout
case 0, system(cmd);
case 1, [status] = system(cmd);
case 2, [status, result] = system(cmd);
@romanz
romanz / gist:968198
Created May 12, 2011 08:55
MATLAB Git wrapper (for Windows)
function [status, result] = git(varargin)
cmd = '"c:\Program Files\Git\cmd\git.cmd"';
for i = 1:numel(varargin)
cmd = [cmd ' ' varargin{i}];
end
switch nargout
case 0, system(cmd);
case 1, [status] = system(cmd);
case 2, [status, result] = system(cmd);