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 / spam.php
Created January 18, 2012 04:25
codejobs - Filter SPAM words - PHP
<?php
function isSPAM($string, $max = 2) {
$words = array(
"http", "www", ".com", ".mx", ".org", ".net", ".co.uk", ".jp", ".ch", ".info", ".me", ".mobi", ".us", ".biz", ".ca", ".ws", ".ag",
".com.co", ".net.co", ".com.ag", ".net.ag", ".it", ".fr", ".tv", ".am", ".asia", ".at", ".be", ".cc", ".de", ".es", ".com.es", ".eu",
".fm", ".in", ".tk", ".com.mx", ".nl", ".nu", ".tw", ".vg", "sex", "porn", "fuck", "buy", "free", "dating", "viagra", "money", "dollars",
"payment", "website", "games", "toys", "poker", "cheap"
);
$count = 0;
@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.
@MilkZoft
MilkZoft / opacity.css
Created January 16, 2012 22:42
code.jobs - Opacity Hack - CSS
selector {
filter: alpha(opacity=60); /* MSIE/PC */
-moz-opacity: 0.6; /* Mozilla 1.6 and older */
opacity: 0.6;
}
@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 / 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 / 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.awk
Created January 23, 2012 03:12
codejobs - Hello World - Awk
# awk -f awk.awk
BEGIN { print "Hello World" }
@MilkZoft
MilkZoft / hello.scpt
Created January 23, 2012 03:14
codejobs - Hello World - AppleScript
display dialog "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);