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 | |
| /** | |
| * Dot notation for access multidimensional arrays. | |
| * | |
| * $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]); | |
| * | |
| * $value = $dn->get('bar.baz.foo'); // $value == true | |
| * | |
| * $dn->set('bar.baz.foo', false); // ['foo'=>false] | |
| * |
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
| // Alerts | |
| @include alert-variant($background, $border, $text-color); | |
| // Background Variant | |
| @include bg-variant($parent, $color); | |
| // Border Radius | |
| @include border-top-radius($radius); | |
| @include border-right-radius($radius); | |
| @include border-bottom-radius($radius); |
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
| /** | |
| * Load all ressources needed for the current website. | |
| * | |
| * @param LoaderInterface $loader | |
| */ | |
| public function registerContainerConfiguration(LoaderInterface $loader) | |
| { | |
| // Load generic configuration | |
| $loader->load(__DIR__.'/config/config.yml'); |
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
| CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
| RETURNS json | |
| LANGUAGE sql | |
| AS $$ | |
| SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
| FROM ( | |
| SELECT * FROM json_each(data) | |
| UNION ALL | |
| SELECT * FROM json_each(insert_data) | |
| ) t; |
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
| # Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats | |
| # Change example.com (server_name) to your website url | |
| # Change /path/to/your/root to the correct value | |
| server { | |
| listen 80; | |
| server_name example.com; | |
| root /path/to/your/root; | |
| index index.html; |
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
| #!/usr/bin/env python | |
| import gevent.monkey | |
| gevent.monkey.patch_all() | |
| import boto | |
| import config | |
| import gevent | |
| import gevent.pool | |
| import 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
| import json | |
| import geojson | |
| from shapely.geometry import shape | |
| o = { | |
| "coordinates": [[[23.314208, 37.768469], [24.039306, 37.768469], [24.039306, 38.214372], [23.314208, 38.214372], [23.314208, 37.768469]]], | |
| "type": "Polygon" | |
| } | |
| s = json.dumps(o) |
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
| // ==UserScript== | |
| // @name Direct Links in Google Search | |
| // @namespace https://github.com/astanin | |
| // @description Remove indirections from Google search results on all TLDs. | |
| // @include https://www.google.tld/*output=search* | |
| // @include http://www.google.tld/*output=search* | |
| // @include https://www.google.tld/search* | |
| // @include http://www.google.tld/search* | |
| // @include https://www.google.tld/#* | |
| // @include http://www.google.tld/#* |
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 | |
| $countries = array | |
| ( | |
| 'AF' => 'Afghanistan', | |
| 'AX' => 'Aland Islands', | |
| 'AL' => 'Albania', | |
| 'DZ' => 'Algeria', | |
| 'AS' => 'American Samoa', | |
| 'AD' => 'Andorra', |