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 | |
use Drupal\Core\Database\Database; | |
$sqlite = Database::getConnection('default'); | |
$mysql = Database::getConnection('mysql'); | |
$schema = $sqlite->query("SELECT name FROM sqlite_schema WHERE type ='table' AND name NOT LIKE 'sqlite_%'")->fetchCol(); | |
$tables = [ |
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
{ | |
"@context": { | |
"@vocab": "", | |
"jsonapi": { | |
"@id": "https://jsonapi.org/", | |
"@prefix": true, | |
"@context": { | |
"@vocab": "https://jsonapi.org/" | |
} | |
}, |
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
# Population of Every Florida County | |
https://api.census.gov/data/2019/pep/population?get=POP&for=county:*&in=state:12 | |
# Number of cases in a Florida county within a date range | |
# @TODO I'm not sure which datetime field is the correct one to be looking at, there are at least 3. | |
https://services1.arcgis.com/CY1LXxl9zlJeBuRZ/arcgis/rest/services/Florida_COVID19_Case_Line_Data_NEW/FeatureServer/0/query?where=County+%3D+%27Orange%27+AND+Case1+%3E%3D+TIMESTAMP+%272020-03-18+00%3A00%3A00%27+AND+Case1+%3C%3D+TIMESTAMP+%272020-04-27+23%3A59%3A59%27&returnCountOnly=true&f=json | |
# Case count for given time range broken down by Florida county | |
https://services1.arcgis.com/CY1LXxl9zlJeBuRZ/arcgis/rest/services/Florida_COVID19_Case_Line_Data_NEW/FeatureServer/0/query?where=EventDate+%3E%3D+TIMESTAMP+%272020-08-30+00%3A00%3A00%27+AND+EventDate+%3C%3D+TIMESTAMP+%272020-09-12+23%3A59%3A59%27&f=json&outStatistics=%5B%7B+%09%22statisticType%22%3A+%22count%22%2C+%09%22onStatisticField%22%3A+%22ObjectId%22%2C+%09%22outStatisticFie |
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
const initialState = { | |
search: '', | |
}; | |
function reducer(state, action) { | |
switch (action.type) { | |
case 'CHANGE': | |
return { | |
...state, | |
[action.name]: action.value |
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 createSearchSubject() { | |
return (new Subject()).pipe( | |
// Whatever you want to do, but the end result should be an action object. | |
) | |
} | |
const initialState = { | |
search: '', | |
}; |
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
<App> | |
<MetaHeader> | |
<Ad /> | |
</MetaHeader> | |
<Header> | |
<Logo /> | |
<Menu> | |
<Link /> | |
<Link> | |
<Menu> |
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 | |
use Drupal\serialization\Normalizer\ContentEntityNormalizer; | |
use Drupal\serialization\Encoder\XmlEncoder; | |
use Symfony\Component\Serializer\Serializer; | |
use Symfony\Component\Serializer\Encoder\JsonEncode; | |
$data = file_get_contents('node.xml'); |
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 | |
$data = \Drupal\Component\Serialization\Yaml::decode(file_get_contents('node.yml')); | |
$entity_type = \Drupal::entityManager()->getDefinition('node'); | |
if ($entity_type->hasKey('bundle')) { | |
$data[$entity_type->getKey('bundle')] = $data[$entity_type->getKey('bundle')][0]['target_id']; | |
} |