Skip to content

Instantly share code, notes, and snippets.

@ynonp
ynonp / dabblet.css
Created December 17, 2011 13:46
An SVG Smiley face
/**
* An SVG Smiley face
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
}
svg {
@ynonp
ynonp / dabblet.css
Created December 17, 2011 17:13
Arcs example
/**
* Arcs example
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
}
svg {
@ynonp
ynonp / dabblet.css
Created December 17, 2011 17:39
Text in path example
/**
* Text in path example
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
}
svg {
#include <QtCore/QtCore>
#include <QtCore/QCoreApplication>
#include <QtCore/QByteArray>
#include <QtCore/QDebug>
#include <QtCore/QLatin1Char>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
static const char mydata[] = {
@ynonp
ynonp / get_numbers.php
Created January 23, 2012 18:25
PHP JSON Example
<?php
header('Content-Type: application/json' );
$a = array(10, 20, 30);
print json_encode($a);
@ynonp
ynonp / riddle.js
Created January 25, 2012 06:05
js intro
function Counter(max) {
var val = 0;
return function() { return (val < max) ? val++ : false; }
;
}
var c = Counter(10);
while (c()) {
console.log(c());
}
@ynonp
ynonp / hero.pl
Created February 10, 2012 18:55
roles as abilities
package Abilities::Base;
use Moose::Role;
sub attack { }
package Abilities::Strong;
use Moose::Role;
with 'Abilities::Base';
@ynonp
ynonp / music.js
Created February 11, 2012 17:26
music box solution
(function() {
var MusicBox = function() {
var _albums = [];
var self = {
addAlbum: function(album) {
_albums.push(album);
},
favoriteAlbum: function() {
.
├── include
│   ├── entry.h
│   ├── photo.h
│   └── user.h
├── lib
├── resources
│   └── default.png
└── src
├── entry.c
<?php
include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if ( $detect->isMobile() ) {
print("Hello Mobile");
} else {
print("Hello Desktop");
}