Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# battery_warn.sh
# Shows a OSD message if batter charge state is too low
# Copyright (c) 2012 Lajos Koszti
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@Ajnasz
Ajnasz / 2display.sh
Created July 27, 2012 15:32
enable screens if connected
#!/bin/zsh
# enables connected, disables disconnected screens
xrandr_state=`xrandr`
current_vga_state=$(echo $xrandr_state | awk '/VGA-0/ {print $2}');
current_dp_state=$(echo $xrandr_state | awk '/DP-0/ {print $2}');
if [[ "$current_vga_state" = "connected" ]];then
xrandr --output LVDS-0 --primary
xrandr --output VGA-0 --auto --right-of LVDS-0
@Ajnasz
Ajnasz / blink-thinklight.sh
Created July 31, 2012 15:29
ThinkPad thinklight blink shell script
@Ajnasz
Ajnasz / checksum.js
Created August 31, 2012 20:58
adblock plus checksum generator
#!/usr/bin/env node
/*jslint node: true*/
var crypto = require('crypto'),
fs = require('fs'),
sys = require('sys');
fs.readFile(process.argv[2], function (er, data) {
if (er) {
throw er;
/*jslint browser: true*/
(function () {
"use strict";
var d = document,
a = document.createElement('div'),
i = 0,
e = '1px solid #a0a',
f,
g,
b,
#!/usr/bin/env node
/*jslint node: true*/
process.chdir('../..');
var spawn = require('child_process').spawn;
var parse = require('uglify-js').parse;
var readline = require('readline');
var fs = require('fs');
var files = [];
@Ajnasz
Ajnasz / a.js
Created October 12, 2012 08:12
Remove iframe grower bug
YUI().use('node', 'test', function (Y) {
"use strict";
var suite, spies, loginRequest, subscription;
spies = {};
loginRequest = {};
suite = new Y.Test.Suite({
name: 'Test'
});
suite.add(new Y.Test.Case({
name: "Test removing iframe",
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>A</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
</head>
<body>
<button type="button" id="ChangeSize">Change Size</button>
<div id="ChartTest" style="width:1000px;"></div>
@Ajnasz
Ajnasz / init-git-repo
Created January 19, 2013 12:30
Shell script to create git repositories
#!/bin/sh
# Copyright (C) 2013 Lajos Koszti
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@Ajnasz
Ajnasz / index.html
Last active December 15, 2015 21:29
Firefox OS day hu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My First Web App \o/</title>
<style type="text/css">
body {
padding: 0;
margin: 0;
}