Skip to content

Instantly share code, notes, and snippets.

View Rho-bur's full-sized avatar
💭
I may be slow to respond.

Robertino Vasilescu Rho-bur

💭
I may be slow to respond.
View GitHub Profile
class ViewportObserver {
constructor() {
const intersectionObserverCallbackClosure = (observerEntries, which) => { this.intersectionObserverFired(observerEntries, which) }
this.viewportObserver = new IntersectionObserver(intersectionObserverCallbackClosure, {
root: null,
rootMargin: "0px 0px 0px 0px"
})
this.nearViewportObserver = new IntersectionObserver(intersectionObserverCallbackClosure, {
root: null,
rootMargin: "200% 0px 200% 0px"
@IanColdwater
IanColdwater / twittermute.txt
Last active December 6, 2025 11:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
server {
listen 80;
server_name fancyapp.com www.fancyapp.com;
location / {
proxy_pass http://localhost:1337;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@tgalopin
tgalopin / symfony-http-client-async-example.php
Created March 2, 2019 21:26
Symfony HttpClient Async example
<?php
$client = \Symfony\Component\HttpClient\HttpClient::create();
// Create a few requests: this is entierely async, requests are launched in the background
$request1 = $client->request('GET', 'http://releases.ubuntu.com/18.04.2/ubuntu-18.04.2-desktop-amd64.iso?request=a');
$request2 = $client->request('GET', 'http://releases.ubuntu.com/18.04.2/ubuntu-18.04.2-desktop-amd64.iso?request=b');
$request3 = $client->request('GET', 'http://releases.ubuntu.com/18.04.2/ubuntu-18.04.2-desktop-amd64.iso?request=c');
// The code continues execution immediatly, you can do whathever you want here ...
@mikermcneil
mikermcneil / stripe-card-element.component.js
Created February 9, 2019 15:37
An example of a component for using Stripe Elements with parasails / Vue.js (`<stripe-card-element>`)
/**
* <stripe-card-element>
* -----------------------------------------------------------------------------
* A wrapper for the Stripe Elements "card" component (https://stripe.com/elements)
*
* Example usage:
* ```
* <stripe-card-element stripePublishableKey="…" v-model="formData.cardInfo"></stripe-card-element>
* ```
*
@mikermcneil
mikermcneil / datepicker.component.js
Created August 20, 2018 21:23
A datepicker component for Vue/parasails, assuming you're using the "Web App" template (aka parasails). _Note: this code was pasted here as of Mon Aug 20, 2018 -- note that this may have been updated or changed in the mean time._
// This goes in `assets/js/components/datepicker.component.js`
// ^^Remove this comment
/**
* <datepicker>
* -----------------------------------------------------------------------------
* A wrapper for the jQuery UI datepicker, which falls back to a date input on mobile.
*
* @type {Component}
*
* @event input [emitted when the value is changed privately]
@craigvantonder
craigvantonder / logstash-mysql-elasticsearch-service.md
Last active September 1, 2020 12:28
Logstash (MySQL -> AWS Elasticsearch Service) Integration in Ubuntu 16.04
@ljharb
ljharb / array_iteration_thoughts.md
Last active February 6, 2026 23:06
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@rhwilr
rhwilr / Awesome-PHP-Development-Environment-on-Arch.md
Last active March 18, 2025 08:51
This is my awesome php development environment

Introduction

The following steps are required for a typical web developer stack for php and some front-end development. This is for a developer machine and not for a live environment!

Installation stack

@julienbourdeau
julienbourdeau / prestashop.conf
Created May 4, 2016 14:23
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;