Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
simonewebdesign / hack.php
Last active December 16, 2015 19:09 — forked from anonymous/hack.php
I did it for teh lulz
<?php
class Foo {
public function bar() {
return "bar";
}
public static function baz() {
@simonewebdesign
simonewebdesign / inheritance.js
Created May 16, 2013 10:47
Simple JavaScript inheritance
function Animal() {
/* properties */
this.isWild = true;
this.name = '';
this.sound = '';
this.height = 0; // cm
this.weight = 0; // kg
this.speed = 0; // km/h
this.age = 0; // years old
@simonewebdesign
simonewebdesign / Preferences.sublime-settings
Last active December 17, 2015 18:49
My super cool Sublime Text 3 user settings preferences
{
"theme": "Soda Dark 3.sublime-theme",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
// "color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
// "theme": "Spacegray.sublime-theme",
// "color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
@simonewebdesign
simonewebdesign / HelloWorld.hs
Created June 19, 2013 13:13
Say "Hello, World!" in Haskell
main = putStrLn "Hello, World!"
Object.prototype.getName = function() {
var funcNameRegex = /function (.{1,})\(/;
var results = (funcNameRegex).exec((this).constructor.toString());
return (results && results.length > 1) ? results[1] : "";
};
@simonewebdesign
simonewebdesign / master.js
Created July 9, 2013 09:02
How to use RequireJS with NivoSlider
<script src="/scripts/require.js"></script>
<script src="/scripts/require.config.js"></script>
<script>
require(['slider'], function ($) {
console.log($); // jquery with slider
//console.log($('.slide').nivoSlider({}));
});
</script>
//
// DetailsController.m
// iOsNative
#import "DetailsController.h"
#import "CustomDetailsCell.h"
#import "JsonReader.h"
#import "PList.h"
@implementation DetailsController
/*
Common vector operations
Author: Tudor Nita | cgrats.com
Version: 0.51
*/
function Vec2(x_,y_)
{
this.x = x_;
this.y = y_;
@simonewebdesign
simonewebdesign / fullscreen.js
Last active September 28, 2023 04:23
go fullscreen on click (cross-browser) - with a single button
$('.fullscreenbutton').on('click', function () {
function toggleFullScreen() {
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
@simonewebdesign
simonewebdesign / events.js
Last active December 20, 2015 19:19
JavaScript how to get all events in window object
var ev = '',
out = [];
for (ev in window) {
if (/^on/.test(ev)) {
out[out.length] = ev;
}
}
console.log(out.join(', '));