Skip to content

Instantly share code, notes, and snippets.

View MilkZoft's full-sized avatar

Carlos Santana Roldán MilkZoft

View GitHub Profile
@MilkZoft
MilkZoft / list.php
Created February 1, 2012 01:22
codejobs - List files - PHP
<?php
function list_files($dir) {
if(is_dir($dir)) {
if($handle = opendir($dir)) {
while(($file = readdir($handle)) !== FALSE) {
if($file !== "." and $file !== ".." and $file != "Thumbs.db") {
echo '<a target="_blank" href="'. $dir . $file .'">'. $file .'</a><br>'."\n";
}
}
@MilkZoft
MilkZoft / email.php
Created February 1, 2012 01:18
codejobs - Send an email - PHP
<?php
$to = "example@gmail.com";
$subject = "Follow @codejobs!";
$body = "Body of your message here you can use HTML too. e.g. <br> <b> Bold </b>";
$headers = "From: Peter\r\n";
$headers .= "Reply-To: info@yoursite.com\r\n";
$headers .= "Return-Path: info@yoursite.com\r\n";
@MilkZoft
MilkZoft / guide.js
Created January 27, 2012 20:52
codejobs - Definitive Guide for JavaScript - JavaScript
/**
* How to create a Javascript object and initialize its properties using dot notation (.)
*/
var codejobs = new Object();
codejobs.url = 'http://www.codejobs.biz';
codejobs.twitter = '@codejobs';
codejobs.getTwitter = function() { return codejobs.twitter; };
@MilkZoft
MilkZoft / hello.scpt
Created January 23, 2012 03:14
codejobs - Hello World - AppleScript
display dialog "Hello World"
@MilkZoft
MilkZoft / hello.awk
Created January 23, 2012 03:12
codejobs - Hello World - Awk
# awk -f awk.awk
BEGIN { print "Hello World" }
@MilkZoft
MilkZoft / hello.apl
Created January 23, 2012 03:10
codejobs - Hello World - APL
@ This program is very simple in APL!
'Hello World!'
@ In APL, anything that is printed in quotes is printed to the terminal. (@ in APL signifies a comment)
@ If the "Hello World statement needed to be stored, then you could use the following :
h<-'Hello World'
h
@Typing h causes h's value to be printed to be printed.
@MilkZoft
MilkZoft / hello.as
Created January 23, 2012 03:07
codejobs - Hello World - ActionScript
package {
import flash.display.Sprite;
import flash.text.TextField;
public class actionscript extends Sprite {
private var hello:TextField = new TextField();
public function actionscript() {
hello.text = "Hello, World!";
addChild(hello);
@MilkZoft
MilkZoft / hello.algol60
Created January 23, 2012 03:00
codejobs - Hello World - Algol
BEGIN
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:11];
REPLACE E BY "HELLO WORLD!";
WHILE TRUE DO
BEGIN
WRITE (F, *, E);
END;
END.
@MilkZoft
MilkZoft / hello.ada
Created January 23, 2012 02:57
codejobs - Hello World - Ada
with Text_To; use Text_To
procedure hello is
begin
put("Hello World");
end hello
@MilkZoft
MilkZoft / hello.cob
Created January 23, 2012 02:54
codejobs - Hello World - Cobol
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.