What is OwnScript? ...you might ask. OwnScript is a programming language based on good parts of specific other languages, namely PHP, JavaScript, Java, Ruby and C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This will produce a CORS error (expected) --> | |
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>--> | |
<element name="x-jquery"> | |
<!-- This will produce a CORS error (expected) --> | |
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>--> | |
<template> | |
<!-- This won't load at all, even with content in the element --> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Signature: array array_column ( array $input , mixed $column_key [, mixed $index_key ] ) | |
if( !function_exists( 'array_column' ) ): | |
function array_column( array $input, $column_key, $index_key = null ) { | |
$result = array(); | |
foreach( $input as $k => $v ) | |
$result[ $index_key ? $v[ $index_key ] : $k ] = $v[ $column_key ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Dwarf; | |
class Path extends Object implements \IteratorAggregate, \Countable { | |
protected $path; | |
public function __construct( $path ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Type { | |
protected $value; | |
public function __construct( $value ) { $this->value = $value; } | |
abstract public function __cast( /* (string) Class name */ $type ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Die Daten in $_GET befinden sich in der URL | |
* http://meine-domain.com/api.php?action=test&nocheins=test2 | |
* Hier ist | |
* $_GET[ 'action' ] === 'test' | |
* $_GET[ 'nocheins' ] === 'test2' | |
* | |
* Die Daten vom POST request befinden sich im Request Body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ACTION}} = Die Aktion, die die PHP API empfangen soll | |
{{METHOD}} = Die HTTP Request Method (Meist GET für lesen, POST für schreiben) | |
{{GET_DATEN}} = Die GET Daten im Query String Format | |
{{POST_DATEN}} = Die POST Daten im Query String Format | |
//prepar request | |
NSString *urlString = [NSString stringWithFormat:@"http://deineurl.com/api.php?action={{ACTION}}&{{GET_DATEN}}"]; | |
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; | |
[request setURL:[NSURL URLWithString:urlString]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.bind = function( entryPoint, middleware, module ) { | |
if( !module ) { | |
module = middleware; | |
middleware = null; | |
} | |
var methods = { get: 'get', post: 'post', put: 'put', delete: 'del' }; | |
for( var i in module ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Simple Captcha Function | |
//Creates funny and not that easily readable captchas | |
// ================ | |
// (c) 2009 by DarkDevine | |
// Modificate as you want, just keep some credits | |
// Fonts from http://urbanfonts.com , you can get new ones there as well | |
// ================ | |
// Usage: generate_captcha( $mode ) for generating the captcha, | |
// check_captcha( $string) for checking with user input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace OwnScript.MyNamespace | |
use OwnScript.SomeOtherNamespace //kein * nötig, da OwnScript keine Klasse, sondern ein Namespace ist | |
use Vendor.Some.Other.Stuff | |
class MyClass > DerivedClass: | |
public myProperty: | |
get: |
OlderNewer