Skip to content

Instantly share code, notes, and snippets.

View Najaf's full-sized avatar

Ali Najaf

View GitHub Profile
@Najaf
Najaf / test-gist.lhs
Created July 19, 2012 08:02
A test gist
A literal haskell gist file
> someHaskellCode :: a -> [a]
@Najaf
Najaf / sidebar.html
Created October 16, 2010 12:50
Test gist
<ul>
<li>
<a href='/home.php'>Home</a>
</li>
<li>
<a href='/about.php'>About</a>
</li>
<li>
<a href='/contact.php'>Contact</a>
</li>
<html>
<head></head>
<body>
<h1>My Web Page</h1>
<?php include 'sidebar.html' ?>
<h2>A title</h2>
<p>Some content</p>
</body>
</html>
@Najaf
Najaf / SECURITY.md
Last active September 10, 2015 19:31

Security inspections

At the beginning of each month, we carry out a brief, high-level security inspection. The purpose is to be a sanity check for head-slapping, trivial vulnerabilities that no one expected would be in the code but somehow managed to creep in anyway.

Who's responsible?

One of @alice, @bob or @charlie should do the inspection if no one else has the time.

How often?

<?php
//calling this with the above files (layout.php + page.php) in the working directory
render_page('page', array(
'title' => "About The Shakes",
'content' => "<p>Bringing the boys to the yard since 1976</p>"
));
//would then render this =>
<?php
function render_page($page, $params = array(), $layout = 'layout') {
extract($params);
$__page = "{$page}.php";
include "{$layout}.php";
}
<?php
function render($page, $params = array()) {
extract($params);
include "{$page}.php";
}
<h3><?= $title ?></h3>
<div id='content'>
<?= $content ?>
</div>
(1..100).each do |i|
print "Fizz" if i % 3 == 0
print "Buzz" if i % 5 == 0
print i.to_s unless i % 3 == 0 or i % 5 == 0
print "\n"
end
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' type='text/css' href='style.css' media='screen' />
<script type='text/javascript' src='jquery.js'></script>
<title>Alis Fruity Milkshakes</title>
</head>
<body>
<div id='wrapper'>
<div id='header'>