Skip to content

Instantly share code, notes, and snippets.

View delineas's full-sized avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@yondemon
yondemon / exportIvooxOPML.js
Created October 6, 2020 08:06
From My Subscriptions ivoox page, run this in console to create an opml file tu export
let hrefArray = document.querySelectorAll('table.table-list tbody tr td:nth-child(5) a')
let errors = []
let contentArray = [
'<?xml version="1.0" encoding="utf-8"?>',
'<opml version="2.0">',
' <head>',
' <title>mySubscriptions.opml</title>',
' <dateCreated></dateCreated>',
' <dateModified></dateModified>',
@acasademont
acasademont / answers.md
Last active October 30, 2020 13:43
Answers to my "Supercharge your apps with ReactPHP & PHP-PM" PHP Barcelona 2019 talk

Question 182: Rasmus didn’t like async idea and he suggested to use queues and put hard works in other workers. What do you think about it?

We're talking about 2 separate things here, the ReactPHP way is not meant to be a replacement for workers to execute long-running tasks. It's meant to be a more efficient way to use your CPU and RAM resources even for very small requests by not blocking the process when doing I/O. Using a workers and queues for long-running tasks in the context of a ReactPHP app is also the recommended approach, do what Rasmus said!!

Question 179 If you want async, why not just use node? ReactPHP seems a very complicated way to achieve the same that node does

The question is, why not? IMHO it's fun and exciting to push the limits of a language. The fact that this hasn't been traditionally done by PHP doesn't mean it can't or shouldn't be tried or done. By thinking this way, Javascript would have never made it to the backends and become Node, because Javascript was never meant t

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@mbrochh
mbrochh / some_test.js
Last active February 8, 2024 13:02
Controlling a Stripe payent popup with Cypress.io
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json
describe('Make Stripe Payment', function() {
before(function() {
cy.visit('http://localhost:3000/en/stripe/checkout/')
Cypress.Cookies.preserveOnce('sessionid')
})
it('should enter credit card details and finalise payment', function() {
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click()
@BrendonKoz
BrendonKoz / auto-caption-tools.md
Last active August 14, 2023 13:28
Automatic Captioning Tools
@jcberthon
jcberthon / update-docker-compose.sh
Last active December 20, 2021 02:56
Downloading and installing/updating latest Docker Compose (command line)
#!/bin/bash
# Copyright 2017-2018 Jean-Christophe Berthon
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@tomconte
tomconte / web3-solc-contract-compile-deploy.js
Created December 13, 2016 09:32
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active July 20, 2023 21:21
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}