Skip to content

Instantly share code, notes, and snippets.

View Thinkscape's full-sized avatar

Arthur Bodera Thinkscape

View GitHub Profile
@jjsquady
jjsquady / nextjs-deploy.md
Last active May 12, 2024 16:04
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@ChadKillingsworth
ChadKillingsworth / e2e-shadowdom.md
Last active July 6, 2023 06:54
Selenium Testing with Shadow DOM

End-to-end Testing with Shadow DOM

As the web component specs continue to be developed, there has been little information on how to test them. In particular the /deep/ combinator has been deprecated in Shadow DOM 1.0. This is particularly painful since most end-to-end testing frameworks rely on elements being discoverable by XPath or calls to querySelector. Elements in Shadow DOM are selectable by neither.

WebDriver.io

Webdriver.io has the standard actions by selectors, but also allows browser executable scripts to return an element

@jarrodirwin
jarrodirwin / storagePolyfill.js
Last active June 21, 2022 14:27 — forked from remy/gist:350433
LocalStorage/SessionStorage Polyfill with Safari Private Browsing support.
// Refer to https://gist.github.com/remy/350433
try {
// Test webstorage existence.
if (!window.localStorage || !window.sessionStorage) throw "exception";
// Test webstorage accessibility - Needed for Safari private browsing.
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
} catch(e) {
(function () {
var Storage = function (type) {
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.
~/tmp$ wget -O poly.poly https://raw.github.com/mauke/poly.poly/master/poly.poly
~/tmp$ file -r -k poly.poly
test: Python script text executable
- C++ source text
- awk script text
- C source text
- C source text
- makefile script text OS/2 REXX batch file text
- HTML document text
- HTML document text
@wmono
wmono / logstash-loglevel.rb
Last active August 29, 2015 13:55
Logstash filter to normalize log level/severity for syslog, JCL, JUL
require "logstash/filters/base"
require "logstash/namespace"
#
# Filter plugin to normalize log levels from various logging frameworks
#
# The output field (log_level by default) will contain a number between
# 100 and 999, inclusive, with higher numbers indicating higher
# importance or severity.
#
@Ocramius
Ocramius / CriteriaTest.php
Created August 16, 2012 09:15
Example of Criteria/Collection API usage in Doctrine 2.3
<?php
/**
* Created by JetBrains PhpStorm.
* User: Marco Pivetta
* Date: 16.08.12
* Time: 11:05
* To change this template use File | Settings | File Templates.
*/
class CriteriaTest extends \PHPUnit_Framework_TestCase
{
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@Ocramius
Ocramius / User.php
Last active February 16, 2024 14:57
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User