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
{"alternativeTitle":"Riks-SOM 2010","accessibilityLevel":"restrictedAccess","bioBank":null,"caseQuantity":5007,"citation":{"en":null,"sv":null},"commissioningOrganisation":{"organisation":{"name":{"en":null,"sv":null},"department":{"en":null,"sv":null},"rorId":null},"registrationNumber":null},"conceptDoi":"10.5878/000487","containsBioBank":false,"containsPersonalData":false,"copyright":{"en":null,"sv":null},"datasetIdentifier":"snd0898-1","description":{"en":"Since 1986 the SOM-institute has been carrying out an annual nation-wide survey - the National SOM - in order to identify the Swedish public\u0027s habits and attitudes on the topics of society, politics and media. National SOM 2010 is accordingly the twentyfifth survey in this series.\n\nPurpose:\n\nThe main purpose is to establish time series that enable researchers to analyse how various changes in society affect people\u0027s attitudes and behaviour.","sv":"Detta \u00E4r den tjugofemte unders\u00F6kningen i serien Riks-SOM, en nationell fr\u00E5geund |
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 requests, json, urllib.request, os.path | |
from jsonschema import validate | |
countValid = 0 | |
countInvalid = 0 | |
api_endpoint = 'https://cthdmps.azurewebsites.net/api/v0/search' | |
bearer_token = 'mytoken' | |
if not os.path.exists('maDMP-schema-1.1.json'): |
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 | |
/**** example usage **** | |
print SubSupText::replaceSubSupHtml("H<sub>2</sub>O") . PHP_EOL; //H₂O | |
print SubSupText::replaceSubSupHtml("42km<sup>2</sup>") . PHP_EOL; //42km² | |
print SubSupText::replaceSubSupHtml("2<sup>th</sup> chapter") . PHP_EOL; //2ᵗʰ chapter | |
*/ | |
class SubSupText{ | |
const superscriptMap = [ | |
'0' => '⁰', '1' => '¹', '2' => '²', '3' => '³', '4' => '⁴', '5' => '⁵', |
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
#!/bin/bash | |
namespace=mynamespace | |
pods=$(kubectl get po -n $namespace -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{end}') | |
for i in $(echo $pods | sed "s/\t/ /g") | |
do | |
case $i in *"$1"*) | |
kubectl logs -n $namespace $i --follow;; | |
esac | |
done |
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 urllib.request | |
import os.path | |
from shapely.geometry import shape, Point | |
# download countries.geojson if needed | |
if not os.path.exists('countries.geojson'): | |
urllib.request.urlretrieve("https://datahub.io/core/geo-countries/r/countries.geojson", "countries.geojson") | |
# load GeoJSON containing country polygons |
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
using System; | |
using System.IO; | |
using System.Text.Json; | |
using System.Text.Json.Nodes; | |
using System.Collections.Generic; | |
using System.Security.Cryptography; | |
using HeyRed.Mime; | |
if(Environment.GetCommandLineArgs().Length == 1){ | |
Console.WriteLine("Provide argument for directory"); |
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 htmlLinksToPlainText(string $html): string{ | |
$htmlDom = new \DOMDocument; | |
@$htmlDom->loadHTML('<?xml encoding="utf-8" ?>'.$html); | |
$links = $htmlDom->getElementsByTagName('a'); | |
foreach($links as $link){ | |
$linkHtml = $htmlDom->saveHTML($link); | |
$linkText = $link->nodeValue; |
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 socket | |
import sys | |
import time | |
import random | |
#docs: | |
# http://www.limitlessled.com/dev/ | |
host = '10.10.10.255' #broadcast ip for my subnet | |
port = 8899 |