Skip to content

Instantly share code, notes, and snippets.

@alexnask
alexnask / admin.html
Created November 15, 2010 20:58
admin.thtml
{[ _GET(name) == _CONFIG(adminName) ]
{[ _GET(password) == _CONFIG(adminPass) ]
<!-- Logged in as administrator -->
{[ _POST(action) == NULL ]
<!-- No action :) -->
{[ _GET(database) == NULL ]
<!-- And no database selected -->
<h1>Listing databases</h1><br/>
<%
@alexnask
alexnask / gist:705107
Created November 18, 2010 15:19
Windows rock compilation error log
Creating bin/ in case it does not exist.
mkdir -p bin/
Compiling from C source
cd build/ && ROCK_DIST=.. make
make[1]: Entering directory `c:/Documents and Settings/alex_/Desktop/rock/build'
Finished compiling for arch 32
gcc -I c-source -I ../libs/headers/ -g -std=gnu99 -Wall -D__OOC_USE_GC__ -DGC_NO_THREAD_REDIRECTS -w -DROCK_BUILD_DATE="\"bootstrapped\"" -DROCK_BUILD_TIME="\"\"" c-source/source/rock/rock.o c-source/sdk/lang/IO.o c-source/sdk/lang/types.o c-source/sdk/lang/Iterators.o c-source/sdk/lang/String.o c-source/sdk/lang/Exception.o c-source/sdk/lang/System.o c-source/sdk/lang/BufferIterator.o c-source/sdk/lang/Abstractions.o c-source/sdk/lang/Character.o c-source/sdk/lang/Format.o c-source/sdk/lang/Buffer.o c-source/sdk/lang/VarArgs.o c-source/sdk/lang/Numbers.o c-source/sdk/lang/Memory.o c-source/sdk/structs/ArrayList.o c-source/sdk/structs/List.o c-source/sdk/math/Random.o c-source/sdk/os/Time.o c-source/sdk/native/win32/types.o c-source/sdk/structs/HashMap.o c-source/sdk/threading/Thread.o c-sou
@alexnask
alexnask / gist:727463
Created December 3, 2010 19:54
Include and execute another file's code in thtml :)
<html>
<p>Hey im html!</p>
<%
ReadFile: data, "someFile.thtml"
Execute: data
%>
<p>Oh, im ended ;(</p>
</html>
@alexnask
alexnask / fileA.html
Created December 3, 2010 20:05
File 'includes' and variable declarations in ooc
<%
Set: a,"a"
ReadFile: data,"fileB.thtml"
Execute: data
Show: b
%>
@alexnask
alexnask / gist:728274
Created December 4, 2010 15:54
thtml sample
<%
Database: "news"
DescOrder: "id"
Column: Title,"title"
Column: Contents,"contents"
LineCount: NewsCount
for[i:0..5]{
if[Title(i) != NULL]{
%>
{"lines":[
{"column1": "value1", "column2": "pewpew"},
{"column1": "lol", "column2": "haha"}
]}
use csfml-system
use csfml-window
use csfml-graphics
import sfml/[Windows,Graphics]
//import menu
main : func -> Int
{
settings := ContextSettings new()
0
Failed to find a pixel format supporting 15993830 antialiasing levels ; trying with 2 levels
Failed to find a pixel format supporting antialiasing ; antialiasing will be disabled
Failed to find a suitable pixel format for the window -- cannot create OpenGL context
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 8 (X_MapWindow)
Resource id in failed request: 0x0
Serial number of failed request: 36
Current serial number in output stream: 37
#include <SFML/Graphics.h>
int main(void)
{
sfRenderWindow *win;
sfVideoMode mode = { 800 , 600 , 32 };
sfRenderWindow_Create(mode,"Title",sfDefaultStyle,NULL);
return 0;
}
cmake -G "Unix Makefiles" -DSFML_SYSTEM_LIBRARY:PATH=C:/SFML/lib/libsfml-system.a -DSFML_SYSTEM_LIBRARY_DEBUG:PATH=C:/SFML/lib/libsfml-system-d.a -DSFML_WINDOW_LIBRARY:PATH=C:/SFML/lib/libsfml-window.a -DSFML_WINDOW_LIBRARY_DEBUG:PATH=C:SFML/lib/libsfml-window-d.a -DSFML_NETWORK_LIBRARY:PATH=C:/SFML/lib/libsfml-network.a -DSFML_NETWORK_LIBRARY_DEBUG:PATH=C:/SFML/lib/libsfml-network-d.a -DSFML_GRAPHICS_LIBRARY:PATH=C:/SFML/lib/libsfml-graphics.a -DSFML_GRAPHICS_LIBRARY_DEBUG:PATH=C:/SFML/lib/libsfml-graphics-d.a -DSFML_AUDIO_LIBRARY:PATH=C:/SFML/lib/libsfml-audio.a -DSFML_AUDIO_LIBRARY_DEBUG:PATH=C:/SFML/lib/libsfml-audio-d.a -DSFML_INCLUDE_DIR:PATH=C:/SFML/include -DSFMLDIR:PATH=C:/SFML -C .
Just building CSFML 2 on windows :P