Skip to content

Instantly share code, notes, and snippets.

@ynonp
ynonp / Storable.pm
Created September 12, 2012 12:47
Dancer Crud
use true;
use v5.14;
use warnings;
{
package YPCourse::Meta::Serializable;
use Moose::Role;
has 'in_db', default => 0, is => 'ro', isa => 'Bool';
has 'form_opts', is => 'ro', isa => 'HashRef', default => sub { {} };
@ynonp
ynonp / game.html
Created September 16, 2012 10:52
Pong Game
<!DOCTYPE html>
<html>
<head>
<title>Pong</title>
<style>
canvas {
border: 2px solid #a7a7a7;
}
</style>
<meta name="viewport" content="user-scalable=0,initial-scale=1,maximum-scale=1,minimum-scale=1" />
@ynonp
ynonp / 01 Exercise
Created September 23, 2012 08:08
Local storage example
1. Write an HTML file that contains a form with 3 fields: name, phone number and email.
2. Add two buttons: "Save" and "Restore"
3. When a user clicks "Save", all form data is saved in local storage
4. When a user clicks "Restore", all form data is filled from local storage
5. (Bonus) Change the program so that whenever a user types anything in any input field all data is saved, and data is automatically restored on page load.
/**
* Created with JetBrains WebStorm.
* User: ynonperek
* Date: 9/23/12
* Time: 11:55 AM
* To change this template use File | Settings | File Templates.
*/
var GameLoop = function() {
@ynonp
ynonp / index.html
Created September 23, 2012 12:54
canvas example
<!DOCTYPE html>
<html>
<head>
<title>Canvas Example</title>
<style>
canvas {
border:5px solid purple;
}
</style>
</head>
@ynonp
ynonp / AndroidManifest.xml
Created September 26, 2012 09:01
Android and IntelliJ for PhoneGap Development
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="16"/>
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
@ynonp
ynonp / dabblet.css
Created September 27, 2012 18:01
Untitled
ul {
list-style: none;
background:#666;
}
ul li {
display:inline-block;
padding:20px
}
@ynonp
ynonp / dabblet.css
Created September 27, 2012 19:05
Untitled
ul {
list-style: none;
background:#666;
}
ul li {
display:inline-block;
padding:1em;
}
@ynonp
ynonp / dabblet.css
Created September 30, 2012 21:40
Untitled
@keyframes cf4FadeInOut {
0% {
opacity:1;
-webkit-transform:rotate(0deg);
}
17% {
opacity:1;
}
25% {
opacity:0;
@ynonp
ynonp / dabblet.css
Created October 15, 2012 14:51
Untitled
body {
background-repeat:no-repeat;
background-image: url(https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRaBkzV2M9yt0uTmVhfS3h4sGwZEwKes5Vx09D2z_6B5v53JSxk22bCkw);
}
@media (orientation: landscape) {
body {
background-image: url(https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRa3VB53Ek7_4LpLBDaYxWkrgf-uQ6XTp20A5YxFBh8pnqBFiXT); }
}