Skip to content

Instantly share code, notes, and snippets.

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

Victoria Nadasdi yitsushi

🏳️‍⚧️
View GitHub Profile
class A
def initialize(parent)
@parent = parent
end
def test
puts "A::test"
end
end
@yitsushi
yitsushi / variable.php
Created January 12, 2011 14:51
Valtozo ami jo hosszu szoveget tartalmaz =/
<?php
$a = 12;
$b = <<<EOV
fasza cucc {$a} ami erteke \$a.
EOV;
echo $b;
@yitsushi
yitsushi / wsYouTube.php
Created February 2, 2011 08:49
test lib
<?php
namespace wsTestLib;
require LIB.'/wsYouTube.php';
class wsYouTube {
var $name = 'YouTube processor';
public function sunrise() {
$this->videos = array(
'available' => array(
# ([ 3, 2, 1, 3, 1, 2, 3 ] * (1000/7)).each { |s| (($x||=0) > 997) ? break : $y = ($y||=0) + ( $x += s ) }
([ 3, 2, 1, 3, 1, 2, 3 ] * (1000/14)).each { |s| (($x||=0) > 997) ? break : $y = ($y||=0) + ( $x += s ) }
@yitsushi
yitsushi / gem_istall_mysql2.output
Created April 15, 2011 10:13
ruby-192 + mysql-51 + windows7_64bit
C:\DevKit>gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL
Server 5.1\lib\opt" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.
1\include"'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb --with-mysql-lib="c:\Program Files\MySQL\MySQ
L Server 5.1\lib\opt" --with-mysql-include="c:\Program Files\MySQL\MySQL Server
.valami_class {
font-size: 12px;
width: 100px;
height: 100px;
background-image: url("../images/blog/type_text.png"); }
.valami_mas_class {
color: #aa0000;
width: 150px;
height: auto; }
@yitsushi
yitsushi / order_by_likes_count.php
Created May 8, 2011 22:25
How to order it ^_^ Just use mapReduce
<?php
require_once "init.php";
$map = new MongoCode("function() {
this.comments_count = this.comments.length;
if (this.likes) this.likes_count = this.likes.length;
else this.likes_count = 0;
emit(this, {count: 1});
}");
<?php
interface ILogin {
public function check_password(
$username,
$password,
$opts = array()
);
public function do_login(
$username,
$password,
@yitsushi
yitsushi / insert.php
Created June 19, 2011 21:37
mysql insert
<?php
DEFINE('MYSQL_LIMIT', 5000);
$datas = array(
array(1,2,3),
array(1,2,3),
array(1,2,3),
array(1,2,3),
array(1,2,3)
);
@yitsushi
yitsushi / virtualbox_with_ruby.rb
Created June 28, 2011 10:35
Get VirtualBox info with ruby...
require "rubygems"
require "virtualbox"
vms = VirtualBox::VM.all
vms.each do |vm|
puts <<EOI
#{vm.name}
#{"="*vm.name.length}
Memory: #{vm.memory_size} MB