This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn prime? [n] | |
(loop [i 2] | |
(if (< i n) | |
(if (not (integer? (/ n i))) | |
(recur (+ i 1)) | |
false | |
) | |
true | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calculate = function(input) | |
{ | |
var result = [], sum = 0; | |
input.forEach(function(element) { | |
sum += element; | |
}); | |
input.forEach(function(element) { | |
result.push(element / sum); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flatten = function(array) | |
{ | |
var result = []; | |
array.forEach(function(element) { | |
if (element instanceof Array) { | |
flatten(element).forEach(function(subElement) { | |
result.push(subElement); | |
}, this); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>Island Generator</title> | |
<?php | |
include 'perlin.php'; | |
$perlin = new Perlin(); | |
$size = isset($_GET['size']) ? intval($_GET['size']) : 128; | |
if ($size > 512) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Allow from any origin | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); | |
header('Access-Control-Allow-Credentials: true'); | |
header('Access-Control-Max-Age: 86400'); // Cache for 1 day | |
} | |
// Access-Control headers are received during OPTIONS requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$tables = array('settings', 'people', 'ratings', 'emails', 'comments', 'accounts'); | |
define('ENTRY_LIMIT', 50); | |
/** | |
* method | |
* The operation you are about to perform | |
* | |
* table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* gulp-wordpress | |
* Nik Sudan | |
* | |
* Commands: | |
* gulp Build the files once | |
* gulp watch Watch for file changes and perform the correct tasks | |
* gulp styles Compiles SASS and injects the new CSS into your webpage | |
* gulp scripts Concats and uglifies js/src into one file | |
* gulp images Compresses images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT u.`user_login` as username, u.`display_name` as name, u.`user_email` as email | |
FROM wp_users u | |
INNER JOIN wp_usermeta m ON m.`user_id` = u.`ID` | |
WHERE m.`meta_key` = 'wp_capabilities' | |
AND (m.meta_value LIKE '%subscriber%') | |
ORDER BY u.`user_login`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /wp-content/uploads/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*) http://example.com/wp-content/uploads/$1 [L,P] | |
</IfModule> |