Skip to content

Instantly share code, notes, and snippets.

View anjan-virtism's full-sized avatar

anjan-virtism

View GitHub Profile
@anjan-virtism
anjan-virtism / countries.js
Last active February 11, 2019 17:34 — forked from e1024kb/gist:41bf38fdb1a2cb19a781
Country List with 2 char and 3 char code
var countries = [
{
name: "Aaland Islands",
code2: "AX",
code3: "ALA",
},
{
name: "Afghanistan",
code2: "AF",
code3: "AFG",
@anjan-virtism
anjan-virtism / get-url-query-string-as-array.php
Created August 8, 2016 03:21
Parse an URL and gets the query string as php array
<?php
/**
* Parse the URL and return the query string as PHP array
*
* @param string $url
*
* @return array
*/
<?php
array( 'start' => 2, 'length' => 20, 'field' => 'IDOrdemPenhora', 'trim' => true,),
array( 'start' => 20, 'length' => 10, 'field' => 'DataOrdemPenhora', 'trim' => true, ),
array( 'start' => 30, 'length' => 4, 'field' => 'ATServiceCode', 'trim' => true, ),
array( 'start' => 34, 'length' => 39, 'field' => 'ATServiceName', 'trim' => true, ),
array( 'start' => 73, 'length' => 60, 'field' => 'ATServiceAddress', 'trim' => true, ),
array( 'start' => 133, 'length' => 8, 'field' => 'ATServiceZipCode', 'trim' => true, ),
array( 'start' => 142, 'length' => 32, 'field' => 'ATServiceLocality', 'trim' => true, ),
array( 'start' => 174, 'length' => 11, 'field' => 'ATServicePhone', 'trim' => true, ),
@anjan-virtism
anjan-virtism / extract-gettext-from-php-files.sh
Last active April 5, 2016 04:50
Extract gettext language strings from all php files inside current directory and it's sub directories
find . -name "*.php" ! -path "./tmp/*" | xargs xgettext --default-domain=myapp --output=myapp.pot --language=PHP --indent --no-wrap --sort-output --omit-header