Skip to content

Instantly share code, notes, and snippets.

View isstaif's full-sized avatar

al-Amjad Tawfiq Isstaif isstaif

View GitHub Profile
@isstaif
isstaif / hello.html
Last active August 29, 2015 14:15
Javascript hello
<html>
<head>
<title>Hello, World!</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" ></script>
</head>
@isstaif
isstaif / client.js
Last active June 9, 2016 21:09
TCP public chat, Node.js
var net = require('net')
, encryption = require('./../encryption')
, ursa = require('ursa')
, exec = require('child_process').exec
, fs = require('fs')
, sh = require('execSync')
var stdin = process.openStdin()
var username, password, connection, privateKey, publicKey, otherPublicKey = false, userNames = [], certificate = false, myId, isNew = true
@isstaif
isstaif / openssl.sh
Last active December 28, 2015 04:59
Generating a certificate using openssl
#generate private key
openssl genrsa -out private-key.pem 4096
#generate signing request
openssl req -new -key private-key.pem -out certificate-signing-request.pem
#self sign the request (or send off the Verisign etc etc)
openssl x509 -req -in certificate-signing-request.pem -signkey private-key.pem -out certificate.pem
#extract public key out of the certificate
@isstaif
isstaif / new.html
Created April 6, 2013 08:45
Simple website using PHP and MySQL
<form action='newpost.php' method=post>
Title: <input type=text name=title />
Body: <input type=text name=body />
<input type=submit />
</form>
@isstaif
isstaif / post.php
Last active December 15, 2015 15:18
A simple template using PHP
<?php
$post = array(
'title' => 'Post title!',
'body' => 'Blah blah blah blah blah blah blah blah blah blah blah '
);
echo "<h1>".$post['title']."</h1>";
echo "<p>".$post['body']."</p>";
echo "<hr />";
@isstaif
isstaif / list.php
Last active December 15, 2015 15:18
A simple list using PHP
<html>
<head></head>
<body>
<?php
$post1 = array(
'title' => 'Title 1',
@isstaif
isstaif / form.html
Created March 31, 2013 11:16
A simple form in HTML and PHP
<html>
<head></head>
<body>
<form action='http://localhost/home.php'>
Title: <input type=text name=title /><br />
Body: <input type=text name=body />
<input type=submit />
@isstaif
isstaif / gist:5280309
Created March 31, 2013 11:13
Hello, World in HTML!
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Title</h1>
<p>Hello, This is a text</p>
@isstaif
isstaif / hello.php
Last active December 15, 2015 15:18
Hello, World in PHP
<?php
echo "<u>Hello, World!</u>";
?>
@isstaif
isstaif / app.js
Created July 15, 2012 17:34
A simple example demonstrating how to use Backbone.js models and views
(function($){
var Post = Backbone.Model.extend({
defaults : {
text : "Default post text",
likes : 0
}
});
var Posts = Backbone.Collection.extend({