Skip to content

Instantly share code, notes, and snippets.

View marlenesco's full-sized avatar

David Foliti marlenesco

View GitHub Profile
@Guibzs
Guibzs / .htaccess
Last active March 26, 2023 15:17
Symfony 4 ~ .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
@acdlite
acdlite / coordinating-async-react.md
Last active March 20, 2022 12:27
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@beesandbombs
beesandbombs / triSpin.pde
Created August 18, 2017 00:19
triangle spin
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@damianociarla
damianociarla / DoctrineQueryPart.php
Created August 16, 2017 13:14
Helps you not duplicate DQL parts in your queries
<?php
namespace Helper;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
class DoctrineQueryPart
{
/**
@keithweaver
keithweaver / put-object-on-aws-s3.php
Last active May 18, 2023 19:20
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@andrewstobbe
andrewstobbe / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Last active July 19, 2021 02:12
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions
@leventebalogh
leventebalogh / .gulp-completion.sh
Last active June 12, 2020 14:31
Fast Gulp auto completion
# Adds basic, but really fast autocompletion for gulp.
#
# NOTE!
# Only the tasknames will be autocompleted.
#
# Why?
# ----
# Default gulp completion is really-really slow, hard to work with.
# However this solution is quite dump, it covers 90% of my workflow.
#
@damianociarla
damianociarla / remove-suffix-class.js
Last active October 28, 2015 11:22
Remove all suffix-classes from selected elements
jQuery.fn.extend({
removeSuffixClass: function(prefix) {
return this.removeClass(function (index, css) {
var pattern = '\\b'+prefix+'\\S+';
var re = new RegExp(pattern, 'g');
return (css.match(re) || []).join(' ');
});
}
});