Skip to content

Instantly share code, notes, and snippets.

View RickardAhlstedt's full-sized avatar

Rickard Ahlstedt RickardAhlstedt

View GitHub Profile
@RickardAhlstedt
RickardAhlstedt / lazy.html
Created September 24, 2019 15:04
lazyload images
<img class="lazy" src="/images/placeholder.png" data-src="' . $sImageUrl . '" alt="" />
@RickardAhlstedt
RickardAhlstedt / wasm.txt
Last active November 8, 2019 08:55
WASM
https://docs.microsoft.com/en-us/windows/wsl/install-win10
https://webassembly.org/
https://developer.mozilla.org/en-US/docs/WebAssembly
https://www.hanselman.com/blog/NETAndWebAssemblyIsThisTheFutureOfTheFrontend.aspx
https://github.com/SteveSanderson/Blazor?WT.mc_id=-blog-scottha / https://github.com/aspnet/blazor
@RickardAhlstedt
RickardAhlstedt / web-ui.txt
Last active November 14, 2019 05:03
Inspiration for ux
https://codemyui.com/magnifying-glass-hover-touch-effect-for-images/
https://gist.github.com/Dronki/58e0c2e6d1148b34c7a2a86c15c793a3
https://gist.github.com/CodeMyUI/e56b3fbb2cc3d335b8148de8a92d6e82
@RickardAhlstedt
RickardAhlstedt / index.html
Created November 14, 2019 05:00 — forked from CodeMyUI/index.html
Sidebar Menu Hover Show/Hide CSS
<html>
<head>
</head>
<body><div class="area"></div><nav class="main-menu">
<ul>
<li>
<a href="http://justinfarrow.com">
<i class="fa fa-home fa-2x"></i>
<span class="nav-text">
@RickardAhlstedt
RickardAhlstedt / php-webscraping.md
Created December 9, 2019 12:14 — forked from anchetaWern/php-webscraping.md
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@RickardAhlstedt
RickardAhlstedt / install_composer.sh
Created January 18, 2020 22:31
Install composer on mac os x
#!/bin/sh
mkdir tmp
cd tmp
curl -sS https://getcomposer.org/installer | php
copy composer.phar /usr/local/bin
echo alias composer="php /usr/local/bin/composer.phar" > ~/.bash_profile
source ~/.bash_profile
cd ..
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
@RickardAhlstedt
RickardAhlstedt / functions.php
Created April 7, 2020 09:39 — forked from maddisondesigns/functions.php
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@RickardAhlstedt
RickardAhlstedt / retry.php
Created May 5, 2020 12:10 — forked from HonzaMac/retry.php
Retry any function in php
<?php
if (!function_exists('retry')) {
/**
* Retries callable
*
* Could be specified how many times, default is 1 times.
*
* @param callable $what
* @param int $retry how many time should it be retried, default is 1
* @return mixed