Skip to content

Instantly share code, notes, and snippets.

@ir-g
ir-g / delete.php
Last active December 17, 2015 12:48
Learn PHP here.
<form method="get">
File to read: <input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<hr />
<?php
unlink($_GET['fname']);
?>
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);
@ir-g
ir-g / jx.js
Created June 15, 2013 14:51
*Not my code, it came from : http://www.openjs.com/scripts/jx/* jx - JavaScript Ajax Library jx is a small toolkit for providing AJAX support in JavaScript. It has two different version - jx and jxs.
//V3.01.A - http://www.openjs.com/scripts/jx/
jx = {
//Create a xmlHttpRequest object - this is the constructor.
getHTTPObject : function() {
var http = false;
//Use IE's ActiveX items to load the file.
if(typeof ActiveXObject != 'undefined') {
try {http = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {http = new ActiveXObject("Microsoft.XMLHTTP");}
@ir-g
ir-g / queryparse.html
Created June 15, 2013 15:31
A set of url handlers
<html>
<head>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&amp;");
for (var i=0;i&lt;vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
@ir-g
ir-g / app.txt
Last active December 19, 2015 10:59
WebAppProject
http://huseyincakir.wordpress.com/2013/02/01/html-into-an-android-application-html-to-apk/
http://phonegap.com/
http://effbot.org/tkinterbook/tkinter-index.htm
https://github.com/TiddlyWiki/tiddlywiki
http://blog.thomasupton.com/2010/12/pastebin-from-the-commandline/
@ir-g
ir-g / ahah.js
Last active December 19, 2015 11:49
PowerJSLibs - Shorter faster code
/* Not mine: http://www.xfront.com/microformats/AHAH.html */
function ahah(url, target, delay) {
var req;
document.getElementById(target).innerHTML = 'waiting...';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req != undefined) {
@ir-g
ir-g / java-servlet.java
Last active December 19, 2015 17:59
Hello Worlds
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
//
// Hello World Java Servlet
//
public class HelloWorld extends HttpServlet {
public void service(HttpServletRequest request,
HttpServletResponse response)
@ir-g
ir-g / chat.php
Last active December 23, 2015 16:19
Chat system of primitive proportions-Uses XML
<html>
<body>
<div>
<?php
if (isset($_REQUEST['chatmessage']))
//if "email" is filled out, send email
{
$user=$_REQUEST['user'];
$file="chatlog.xml";
$chatmessage=$_REQUEST['chatmessage'];
@ir-g
ir-g / spec.md
Last active December 31, 2015 05:58
Announcing Americano spec 0.5. -- A sneak code preview.

#Core spec

Hello World

Braced

init Main {
	print("Hello World!");
}

Cleansed

init Main
	print "Hello World!"

Variable declaration