Skip to content

Instantly share code, notes, and snippets.

View Mika-'s full-sized avatar

Mika Simanainen Mika-

View GitHub Profile
@Mika-
Mika- / gist:185c8d777aab3ebba548
Created February 11, 2015 15:26
Resize and convert image to web optimized jpg with imagemagick and mozjpeg
convert source.png -resize 1920x1080 -background white -flatten TGA:- | cjpeg -quality 90 -targa -outfile compressed.jpg
@Mika-
Mika- / favicon.bat
Created June 17, 2015 18:07
Create a multi resolution favicon with imagemagick
convert logo.png -background transparent -resize 64x64 -gravity center -extent 64x64 ^
( -clone 0 -resize 48x48 ) ^
( -clone 0 -resize 32x32 ) ^
( -clone 0 -resize 16x16 ) ^
-colors 256 -alpha background favicon.ico
@Mika-
Mika- / google-analytics.amp.html
Created October 18, 2015 10:34
Use Google Analytics in AMP HTML
<amp-pixel src="https://ssl.google-analytics.com/collect?v=1&amp;tid=UA-12345678-1&amp;t=pageview&amp;cid=$RANDOM&amp;dt=$TITLE&amp;dl=$CANONICAL_URL&amp;z=$RANDOM"></amp-pixel>
/*
* Required parameters:
* v = API version number (currently 1)
* tid = Google Analytics property identifier (UA-12345678-1)
* t = hit type
* cid = client id (you should implement this via cookie etc.)
* z = random string to bypass caching (amphtml generates this to $RANDOM variable)
curl -s "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext" | sed "s/127\.0\.0\.1/0.0.0.0/" > /etc/dnsmasq.d/dnsmasq.adlist.conf
/etc/init.d/dnsmasq force-reload
C:\WINDOWS\system32> dism /online /get-capabilities | findstr /i "OpenSSH"
Capability Identity : OpenSSH.Client~~~~0.0.1.0
Capability Identity : OpenSSH.Server~~~~0.0.1.0
C:\WINDOWS\system32>dism /online /Add-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0
Deployment Image Servicing and Management tool
Version: 10.0.16299.15
Image Version: 10.0.16299.64
<?php
/**
* Find first element from array by callback
*
* @param array|\Traversable $array
* @param callable $callback
* @return mixed|null
*/
function array_find($array, callable $callback)
<?php
/**
* Sort array of string by relevance
*
* @param array $array
* @param string $query
* @return array
*/
function array_sort_suggest(array $array, string $query) : array
<?php
/**
* Get first element from array
*
* @param array $array
* @return mixed|null
*/
function array_first(array $array)
{
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
We can't make this file beautiful and searchable because it's too large.
ID,NAME,CREATED,UPDATED,USERS,OPEN_SOURCE,DISABLED
1865,Adblock Plus,2006-01-17T07:28:30Z,2020-04-01T00:00:11Z,9410625,,false
607454,uBlock Origin,2015-04-25T07:26:22Z,2020-05-16T01:30:13Z,5891321,,false
3006,Video DownloadHelper,2006-07-22T05:20:43Z,2020-04-21T14:35:13Z,3094587,,false
431482,Easy Screenshot,2013-04-16T01:57:25Z,2019-04-25T07:35:09Z,2933265,,false
735601,Cisco Webex Extension,2016-09-22T09:15:31Z,2019-07-11T04:45:13Z,2706590,,false
954390,Facebook Container,2018-03-22T18:36:07Z,2020-04-13T20:31:25Z,2075780,,false
722,NoScript Security Suite,2005-05-13T10:51:32Z,2020-05-15T19:40:12Z,1841278,,false
9609,Ghostery – Privacy Ad Blocker,2008-11-15T11:19:34Z,2020-04-13T15:47:15Z,1581019,,false
506646,Privacy Badger,2014-05-01T18:23:16Z,2020-05-13T15:04:13Z,1414073,,false