Skip to content

Instantly share code, notes, and snippets.

View roxlukas's full-sized avatar

Łukasz Poźniak roxlukas

View GitHub Profile
@nknapp
nknapp / wipe-docker.sh
Created January 1, 2017 21:26
Clear the complete docker environment
#!/bin/bash
echo Killing all containers
for i in $( docker ps -q ) ; do
docker kill $i
done
echo Removing all containers
for i in $( docker ps -aq ) ; do
docker rm $i
URI: http://crest.regner.dev/market/10000002/orders/sell/?type=http://crest.regner.dev/inventory/types/587/
{
"totalCount_str": "6",
"items": [
{
"volume_str": "20",
"buy": false,
"issued": "2014-10-30T12:23:35",
"price": 323108,
@regner
regner / CREST Documentation Example
Last active August 29, 2015 14:08
Updating with newest example.
{
"mediatypes": [
{
"attributes": {
"text": {
"type": "String",
"description": "Text of the document",
"isOptional": false
}
},
@gavinhungry
gavinhungry / nginx-tls.conf
Last active March 11, 2024 14:51
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@dalethedeveloper
dalethedeveloper / gist:1503252
Created December 20, 2011 21:00
Mobile Device Detection via User Agent RegEx

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(

@mncaudill
mncaudill / similar.php
Created October 31, 2011 05:33
PHP version of simple image similarity algorithm
<?php
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
$filename = 'image.jpg';
list($width, $height) = getimagesize($filename);
$img = imagecreatefromjpeg($filename);
$new_img = imagecreatetruecolor(8, 8);