Swedish counties, municipalities and districts in JSON format.
Svenska län och kommuner och distrikt i JSON format.
Downloaded from SCB 13 jan 2021.
# Test | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# Remove | |
find . -name "node_modules" -type d -prune -print -exec rm -rf "{}" \; |
<?php | |
function restrict_post_deletion ($post_ID) { | |
$restricted_pages = [ | |
get_option('page_on_front'), | |
123, | |
666 | |
]; | |
if (!current_user_can('administrator') && in_array($post_ID, $restricted_pages)) { |
name: Build and deploy | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: |
Swedish counties, municipalities and districts in JSON format.
Svenska län och kommuner och distrikt i JSON format.
Downloaded from SCB 13 jan 2021.
<?php | |
function getElementAttribute ($attribute, $html) { | |
if (preg_match('/' . $attribute . '="([^"]+)"/', $html, $match)) { | |
return $match[1]; | |
} | |
return false; | |
} |
<?php | |
if ( ! function_exists( 'get_attachment_id_from_url' ) ) { | |
/** | |
* Get the attachment ID for a given file url | |
* | |
* @link http://wordpress.stackexchange.com/a/7094 | |
* @param string $url | |
* @return boolean|integer | |
*/ |
<?php | |
/** | |
* Remove default output of og:image from yoast | |
*/ | |
add_filter('wpseo_frontend_presenter_classes', function ($filter) { | |
$presenter_to_remove = [ | |
'Yoast\WP\SEO\Presenters\Open_Graph\Image_Presenter' | |
]; |
const API_KEY = 'XXXXXXXXXXXXXXXXX' | |
export const fetchStock = async (productId = '') => { | |
try { | |
const response = await fetch(`https://app.snipcart.com/api/products/${productId}`, { | |
headers: { | |
'Authorization': 'Basic ' + Buffer.from(API_KEY + ':').toString('base64'), | |
'Accept': 'application/json', | |
}, | |
}).then(res => res.json()) |
import React from 'react' | |
import { Animated } from 'react-native' | |
import Canvas, { Image as CanvasImage } from 'react-native-canvas' | |
const TransparentImage = ({ source, width, height, backgroundColor }) => { | |
const fadeAnim = React.useRef(new Animated.Value(0)).current | |
return ( | |
<Animated.View | |
style={{ |