Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@yondemon
yondemon / exportIvooxOPML.js
Created Oct 6, 2020
From My Subscriptions ivoox page, run this in console to create an opml file tu export
View exportIvooxOPML.js
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 Oct 30, 2020
Answers to my "Supercharge your apps with ReactPHP & PHP-PM" PHP Barcelona 2019 talk
View answers.md

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

View generator-docs.md
@jcberthon
jcberthon / update-docker-compose.sh
Last active Jan 28, 2020
Downloading and installing/updating latest Docker Compose (command line)
View update-docker-compose.sh
#!/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 Dec 13, 2016
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
View web3-solc-contract-compile-deploy.js
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 Jan 19, 2021
Troubleshooting Valet on macOS Sierra
View troubleshooting.md

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 Jan 22, 2021
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet
View drupal_8_twig_cheatsheet.md

Drupal 8 Twig cheatsheet

Getting Drupal 8 field values in Twig

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

Image title text: {{ node.field_name.title }}

Entity Reference path: {{ content.field_tags[0]['#url'] }}

@rossriley
rossriley / CSVImportCommand.php
Created Jul 25, 2016
Import Content to Bolt from CSV File
View CSVImportCommand.php
<?php
namespace Mysite\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use Bolt\Application;