Skip to content

Instantly share code, notes, and snippets.

View RickardAhlstedt's full-sized avatar

Rickard Ahlstedt RickardAhlstedt

View GitHub Profile
@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 / 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 / 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 / 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 / lazy.html
Created September 24, 2019 15:04
lazyload images
<img class="lazy" src="/images/placeholder.png" data-src="' . $sImageUrl . '" alt="" />
<?php
function cache_set($key, $val) {
$val = var_export($val, true);
// HHVM fails at __set_state, so just use object cast for now
$val = str_replace('stdClass::__set_state', '(object)', $val);
// Write to temp file first to ensure atomicity
$tmp = "/tmp/$key." . uniqid('', true) . '.tmp';
file_put_contents($tmp, '<?php $val = ' . $val . ';', LOCK_EX);
rename($tmp, "/tmp/$key");
}
@RickardAhlstedt
RickardAhlstedt / Exit.cs
Created July 24, 2019 07:17 — forked from IronMonk-UK/Exit.cs
The C# code for the Text Adventure
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TextAdventure
{
class Exit
{