This file contains hidden or 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 twoSum($nums, $target) { | |
for($a = 0, $max = count($nums);$a < $max-1; $a++) { | |
$looking = $target - $nums[$a]; | |
$where = array_slice($nums, $a+1); |
This file contains hidden or 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
package main | |
import ( | |
"database/sql" | |
"encoding/csv" | |
"flag" | |
_ "github.com/go-sql-driver/mysql" | |
"io" | |
"log" | |
"os" |
This file contains hidden or 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 | |
if ( ! function_exists('parse_address')) | |
{ | |
// https://github.com/gordonlkc/autralia-address-parser/blob/master/parser.js | |
/** | |
* match state |
This file contains hidden or 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
package sanitze | |
import ( | |
"bytes" | |
) | |
var transliterations = map[rune]string{'\u0041': "A", '\u24B6': "A", '\uFF21': "A", '\u00C0': "A", '\u00C1': "A", '\u00C2': "A", '\u1EA6': "A", '\u1EA4': "A", '\u1EAA': "A", '\u1EA8': "A", | |
'\u00C3': "A", '\u0100': "A", '\u0102': "A", '\u1EB0': "A", '\u1EAE': "A", '\u1EB4': "A", '\u1EB2': "A", '\u0226': "A", '\u01E0': "A", '\u00C4': "A", | |
'\u01DE': "A", '\u1EA2': "A", '\u00C5': "A", '\u01FA': "A", '\u01CD': "A", '\u0200': "A", '\u0202': "A", '\u1EA0': "A", '\u1EAC': "A", '\u1EB6': "A", | |
'\u1E00': "A", '\u0104': "A", '\u023A': "A", '\u2C6F': "A", '\uA732': "AA", '\u00C6': "AE", '\u01FC': "AE", '\u01E2': "AE", '\uA734': "AO", '\uA736': "AU", |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"unicode" | |
"golang.org/x/text/transform" | |
"golang.org/x/text/unicode/norm" | |
) |
This file contains hidden or 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
package main | |
import ( | |
"strings" | |
"fmt" | |
) | |
func main() { | |
var str strings.Builder |
This file contains hidden or 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 | |
// Fetches the value of $_GET['user'] and returns 'nobody' | |
// if it does not exist. | |
$username = $_GET['user'] ?? 'nobody'; | |
// This is equivalent to: | |
$username = isset($_GET['user']) ? $_GET['user'] : 'nobody'; | |
// Coalescing can be chained: this will return the first | |
// defined value out of $_GET['user'], $_POST['user'], and |
This file contains hidden or 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
# GOROOT is the location where Go package is installed on your system | |
export GOROOT=/usr/lib/golang | |
# GOPATH is the location of your work directory | |
export GOPATH=$HOME/go | |
# PATH in order to access go binary system wide | |
export PATH=$PATH:$GOROOT/bin |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
const subConfrmType = "SubscriptionConfirmation" |
This file contains hidden or 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
#include <Keypad.h> | |
#define PasswordLength 5 | |
const byte ROWS = 4; //four rows | |
const byte COLS = 4; //three columns | |
char keys[ROWS][COLS] = { | |
{'1','2','3', 'A'}, | |
{'4','5','6', 'B'}, | |
{'7','8','9', 'C'}, |