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 | |
declare(strict_types=1); | |
namespace App\Enums; | |
enum State: string | |
{ | |
case ALABAMA = 'AL'; | |
case ALASKA = 'AK'; |
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
package j2p; | |
import japa.parser.JavaParser; | |
import japa.parser.ParseException; | |
import japa.parser.ast.CompilationUnit; | |
import japa.parser.ast.ImportDeclaration; | |
import japa.parser.ast.PackageDeclaration; | |
import japa.parser.ast.body.BodyDeclaration; | |
import japa.parser.ast.body.ClassOrInterfaceDeclaration; | |
import japa.parser.ast.body.FieldDeclaration; |
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
Function.prototype.compile = function() { | |
var template = this.toString().split('\n').slice(1,-1).join('\n') + '\n'; | |
return Ember.Handlebars.compile(template); | |
} | |
/*******************************************************/ | |
test('sets first tab found to active', function() { | |
expect(2); | |
var component = this.subject({ |
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 | |
define('PACKAGE_LIST', 'list.txt'); | |
define('CODING_STANDARD', 'PSR2'); | |
define('SEVERITY', 1); | |
define('ENCODING', 'utf-8'); | |
define('REPORT', 'source'); | |
define('EXTENSIONS', 'php'); | |
$excluded = [ | |
'*/test/*', |
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
/** | |
* Geocode address | |
* | |
* REQUIREMENTS | |
* - Google Maps API | |
* - HTML5 Geolocation API | |
*/ | |
var geocode = function (address, onSuccess, onError) { | |
var geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({ address: address }, function (results, status) { |
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
/** | |
* Utility class for dealing with SVG elements | |
* Copyright Virtuosi Media, Inc. 2012 | |
* MIT License | |
*/ | |
var SVG = new Class({ | |
/** | |
* @param string - el - The type of SVG element | |
* @param object - options - The attributes and values for the SVG element, stored in a hash |
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 get_latlng ($address) | |
{ | |
// api key | |
$key = ''; | |
// maps geocode api request | |
$url = "https://maps.googleapis.com/maps/api/geocode/json"; | |
$query = "?address=" . urlencode($address) . "&sensor=false"; |
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 people = ['Daniel', 'Dustin', 'David', 'Damarcus', 'Russ']; | |
function matchPeople(input) { | |
var regex = new RegExp('[' + input.split('').join(']+.*[') + ']+', 'ig'); | |
return people.filter(function(person) { | |
if (person.match(regex)) return person; | |
}); | |
} | |
console.log(matchPeople('dvd')); // returns ['David'] |
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
•_•) | |
( •_•)>⌐■-■ | |
(⌐■_■) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body | |
{ | |
margin: 0; | |
padding: 0; | |
background: #fff; |
NewerOlder