Skip to content

Instantly share code, notes, and snippets.

use v5.14;
use Data::Printer;
my @letters = ('a'..'f');
my @numbers = (0..7);
my %contacts = ( Mike => 7, Jim => 5 );
my @data = (\@letters, \@numbers, \%contacts);
p @data;
use v5.14;
use autodie;
# DIE
open my $f, '<', 'invalid.txt';
<!DOCTYPE html>
<html>
<head>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" />
<link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootstrap Example</title>
<style>
function Foo() {
}
var p = {
name: 'Mike',
job: 'Musician'
};
Foo.prototype = p;
use v5.14;
use List::Util qw/sum/;
sub add_to_hash {
my ( $hash_ref, $key, $value ) = @_;
$hash_ref->{$key} = $value;
}
@ynonp
ynonp / demo1.rb
Created August 2, 2012 15:49
qt demo1
require 'Qt'
require './demo1_ui.rb'
a = Qt::Application.new(ARGV)
u = Ui_Form.new
w = Qt::Widget.new
u.setupUi(w)
w.show
u.btn1.connect( SIGNAL :clicked ) {
@ynonp
ynonp / transition.html
Created August 19, 2012 13:24
transition.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Wow CSS3</title>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<meta name="viewport" content="initial-scale=1,user-scalable=0,maximum-scale=1,minimum-scale=1" />
<style>
div.right {
width:200px;
global.views.AppView = Backbone.View.extend({
el: $('body'),
events: {
"click .add-btn": "add_task"
},
add_task: function() {
var task_description = this.$el.find('input').val();
var tm = new global.models.Task({ text: task_description });
/**
משחקון מצא את היוצא דופן לסמארטפון
במשחק מוצגים על המסך 4 עצמים, והמשתמש צריך לבחור את היוצא דופן.
בנוסף, על המסך מוצג גם לוח תוצאות.
הקוד מתאר גישה מונחית עצמים לבעייה. אנו מגדירים אובייקט לכל אחד מהאלמנטים הפעילים שצריכים להופיע על המסך:
דמות שצריך ללחוץ עליה כדי לנצח
3 דמויות שלחיצה עליהן גורמת להפסד
פאנל של תוצאות
/**
* Created with JetBrains WebStorm.
* User: ynonperek
* Date: 8/21/12
* Time: 9:36 AM
* To change this template use File | Settings | File Templates.
*/
(function() {
var Score = function() {
this.value = 0;