Skip to content

Instantly share code, notes, and snippets.

View eriksape's full-sized avatar

Erik Sanchez Pérez eriksape

View GitHub Profile
@willurd
willurd / web-servers.md
Last active April 25, 2024 01:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@danharper
danharper / CatchAllOptionsRequestsProvider.php
Last active April 20, 2024 01:53
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@indexzero
indexzero / ISC.md
Created April 13, 2014 21:00
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@ony
ony / budgeting.md
Last active March 5, 2024 06:48
Budgeting with hledger

The main answers I need from budgeting:

  • How much extra money I can spend without compromising ability to pay my bills?
  • How big my earnings should be to cover my expenses?
  • How can I optimize my expenses?

Tracking your expenses

One of my favorite reports hledger supports is

@joshmfrankel
joshmfrankel / fixBrokenHTMLString.php
Last active September 8, 2023 12:22
PHP: Fix broken html tags in string and use html entities
/**
* Fix for broken html tags inside strings for php.
*
* By using passing the html through DOMDocument and converting the html
* entities we are left with beautiful well formatted code. Huzzah!
*
* "Nothing is ever easy" -Zedd, Wizards First Rule
*
* @var DOMDocument
*/
@max-mapper
max-mapper / readme.md
Last active May 21, 2022 11:02
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. compile ffmpeg for arm https://github.com/fiorix/ffmpeg-arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

@nicobytes
nicobytes / steps.md
Last active November 9, 2020 00:41
Performance monitoring with Lighthouse CI

1. Install the Lighthouse CI CLI.

npm install -g @lhci/cli

2.