Skip to content

Instantly share code, notes, and snippets.

View yitsushi's full-sized avatar
🏳️‍⚧️

Victoria Nadasdi yitsushi

🏳️‍⚧️
View GitHub Profile
@yitsushi
yitsushi / browsers.text
Created July 2, 2011 16:32
Memory usage of Browsers
Scripts:
--------
ps aux | grep -i firefox | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
ps aux | grep -i safari | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
ps aux | grep -i chrome | awk '{sum += $4} END {print 4*1024 * (sum/100)}'
Time-Table:
-----------
Name Mega
@yitsushi
yitsushi / array_object_extend.php
Created July 5, 2011 23:00
How to extend the ArrayObject and create a custom array
<?php
class MyArray extends ArrayObject {
function __construct($array = array()){
parent::__construct($array, ArrayObject::ARRAY_AS_PROPS);
}
public function get_property_string($sep = ':') {
return implode($sep, $this->getArrayCopy());
}
-- Show current song
-- by Balazs Nadasdi
set the enabledNotification to {"iTunes Current Song"}
tell application "System Events"
set isGrowlRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
set isiTunesRunning to (count of (every process whose bundle identifier is "com.apple.iTunes")) > 0
end tell
@yitsushi
yitsushi / xmlmerge.rb
Created May 17, 2012 19:05
merge new file entries into the old translated strings.xml for android translators (doesn't override original files)
require 'rubygems'
require 'xmlsimple'
old_file = ARGV[0] rescue nil
new_file = ARGV[1] rescue nil
output = ARGV[2] rescue nil
if old_file.nil? or new_file.nil?
puts "#{$0} <old_string.xml> <new_string.xml> [output_string.xml]"
exit
@yitsushi
yitsushi / DIVrefresh.html
Created August 25, 2012 20:20 — forked from droid242/DIVrefresh
DIV refresh
<!DOCTYPE html>
<html lang="hu">
<head>
<title>DIV refresh page</title>
<meta charset="utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
// en jobban szeretem a jQuery format mint a jQuery-et
// mert igy kisebb az esely hogy osszeakad massal :)
@yitsushi
yitsushi / Google+ DB.js
Created August 28, 2012 18:22
Google App Script for Google Form: get displayName from Google+ ID
/**
* Set a trigger:
* onFormSubmit -> getDisplayName
*
* Form: Google+ ID (must be the first column in the form)
* or you need to change `id = e.values[1];` line
* in getDisplayName function to the correct column number
*
* Author: Balazs Nadasdi
* <[email protected]>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link href="data:image/x-icon;base64,AAABAAEAEBACAAAAAACwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAQAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//gAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA" rel="icon" type="image/x-icon" /></head>
<body>
</body>
</html>
@yitsushi
yitsushi / download-youtube-link.js
Created November 27, 2012 16:03
SalsaTune Youtube Download Link
@yitsushi
yitsushi / robot.js
Created December 4, 2012 22:09
Folyam
var cloned = false;
var cloneTick = 0;
//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;
@yitsushi
yitsushi / robot.js
Created December 4, 2012 22:28 — forked from mdonahoo/robot.js
Folyam2
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {};
var target = null;
var intelAge = 0;
var cloned = false;
var pointAt = function(robot, enemy)