Skip to content

Instantly share code, notes, and snippets.

View wingsline's full-sized avatar
😃

Arpad Olasz wingsline

😃
View GitHub Profile
@marcoarment
marcoarment / S3.php
Last active June 25, 2023 19:41
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@valorin
valorin / Middleware-CSP.php
Last active May 2, 2024 19:29
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@jfcherng
jfcherng / SimpleCrypto.php
Created October 26, 2019 20:22
Yet another simple encryption/decryption wrapper.
<?php
declare(strict_types=1);
namespace App\Core;
use RuntimeException;
class SimpleCrypto
{
@adampatterson
adampatterson / sample.php
Created October 18, 2017 00:50
Whoops PHP Storm Config
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
@ghosh
ghosh / micromodal.css
Last active May 14, 2024 16:34
Demo modal styles for micromodal.js and corresponding expected html. If using this, set the `awaitCloseAnimation` in config to true
/**************************\
Basic Modal Styles
\**************************/
.modal {
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;
}
.modal__overlay {
position: fixed;
@iansvo
iansvo / readme.md
Last active December 12, 2016 07:35

#Description This AppleScript will automatically sync using a predefined Favorite and all enabled Skip Rules. I use this with Codekit to autosync files when they are processed.

##Instructions

  1. Line 2 needs to be updated with the name of the Favorite in question.
  2. For best results, set the local/remote paths directly in your favorite. If you don't, you'll need to update lines 7 and 8.

##Codekit Instructions

@tuespetre
tuespetre / template-polyfill.js
Created October 21, 2016 19:19
Allows you to use templates for custom elements in IE11. Wrote this to be able to use webcomponents/shadycss
(function (document) {
if ('content' in document.createElement('template')) {
return;
}
Object.defineProperty(HTMLUnknownElement.prototype, 'content', {
enumerable: false,
configurable: true,
get: function() {
if (this.localName !== 'template') {
@developerdino
developerdino / ThrottleRequests.php
Created February 16, 2016 04:12
Lumen Middleware for rate limiting - based on Laravel's implementation.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
use Illuminate\Cache\RateLimiter;
class ThrottleRequests
{

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

@sminnee
sminnee / foo.php
Last active November 5, 2015 23:20
Custom generator classes with IteratorAggregate
<?php
class ForLoop implements IteratorAggregate
{
public $from = 0, $to, $step = 1;
function getIterator() {
for($i = $this->from; $i <= $this->to; $i += $this->step) {
yield $i;