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
// @see http://dstromberg.com/2013/07/tutorial-random-maze-generation-algorithm-in-javascript/ | |
var pot = [[currentCell[0]+1, currentCell[1], 2, 0], | |
[currentCell[0], currentCell[1]+1, 1, 3], | |
[currentCell[0]-1, currentCell[1], 0, 2], | |
[currentCell[0], currentCell[1]-1, 3, 1]]; |
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 | |
function generateUsername() { | |
$small = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); | |
$capital = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); | |
$numbers = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); | |
$f = rand(0, 25); | |
$s = rand(0, 25); |
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
#!/usr/bin/python | |
import sys | |
import gtk | |
import appindicator | |
import urllib2 | |
import re | |
import datetime | |
from xml.dom.minidom import parseString | |
from Calculator import * |
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 | |
class RegionVO { | |
const NSW = 35; | |
const ACT = 37; | |
const VIC = 38; | |
const QLD = 9; | |
const SA = 36; | |
const WA = 39; | |
const NT = 40; |
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 | |
/** | |
* Saves remote image using Curl request | |
* @param string $img URL from which image is to be retrieved | |
* @param string $fullpath Full path to the image | |
* @param string $imageVerify Fullpath where image will be saved. | |
* @see http://stackoverflow.com/questions/10890617/grabbing-image-with-curl-php | |
*/ | |
function saveImage($img, $fullpath = null, $imageVerify = 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
#!/usr/bin/python | |
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions. | |
# Michael Davis ([email protected]) | |
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import select |
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
[ | |
{ "keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false} }, | |
{ "keys": ["ctrl+shift+y"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": "Set Syntax: "} }, | |
{ "keys": ["ctrl+super+t"], "command": "phpcs_clear_sniffer_marks" }, | |
{ "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}, | |
{ "keys": ["f6"], "command": "expand_fqcn" }, | |
{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} }, | |
{ "keys": ["f5"], "command": "find_use" }, | |
{ "keys": ["f4"], "command": "import_namespace" }, | |
{ "keys": ["f3"], "command": "implement" }, |
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
1. Download phpunit.phar from phpunit.de | |
2. then configure "c:\bin\" in PATH environment variable. | |
3. Create new file "phpunit.bat" and paste the below code inside the file | |
```bash | |
@ECHO OFF | |
php "%~dp0phpunit.phar" %* | |
``` | |
4. Test the implementation using `phpunit --version`. |
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 | |
/** | |
* PHP Code snippet to test the color coding for the CLI output | |
* In Console the output is: | |
* | |
* The code is 1;42m | |
* | |
* Run with - `php console_code_color.php` | |
* | |
**/ |
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
/** | |
* Filename : ConsolePassword.java | |
* @package : com.fivedots | |
* | |
* ConsolePassword is inside "Hello" project. Thus CD into the folder first, my case its "F:\workspace\Hello\" | |
* - cd F:\workspace\Hello | |
* - cd src | |
* - javac "com/fivedots/ConsolePassword.java" | |
* - java com.fivedots.ConsolePassword | |
**/ |
OlderNewer