Skip to content

Instantly share code, notes, and snippets.

View alfondotnet's full-sized avatar
🏄‍♂️
🏄 🏄 🏄 🏄 🏄 🏄 🏄

Alfonso Embid-Desmet alfondotnet

🏄‍♂️
🏄 🏄 🏄 🏄 🏄 🏄 🏄
View GitHub Profile
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active July 12, 2024 22:22
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@jhusain
jhusain / PEG grammer for pattern match syntax
Created October 29, 2016 03:29
PEG grammer for pattern match syntax. Forked from JSON grammer.
JSON_text
= ws value:value ws { return value; }
begin_array = ws "[" ws
begin_object = ws "{" ws
end_array = ws "]" ws
end_object = ws "}" ws
name_separator = ws ":" ws
value_separator = ws "," ws
@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

Update: download the new Pokemon Go app - it fixes all of this. Download it, and reauth, and you should be set. The grant scopes and prompt are correct and visible now too! Now if only I could actually find a pikachu...

Pokemon tokens are requested with these understandable scopes:

@ethicalhack3r
ethicalhack3r / euskalhack.md
Created February 29, 2016 15:36
[CFP] EuskalHack (San Sebastian / Donostia) 2016

Introduction

EuskalHack Security Congress is the first Ethical Hacking association in Euskadi, with the aim of promoting the community and culture in digital security to anyone who may be interested.

This exclusive conference is shaping up to be the most relevant in the Basque Country, with an estimated 125 attendees for the first edition.

The participants include specialised companies, state security organisations, professionals, hobbyists and students in the area of security and Information Technology.

Estimated date and location

@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@chollier
chollier / pre-commit eslint
Last active February 25, 2016 23:18
Pre-commit ESLINT hook using npm's binary
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".js\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@nruth
nruth / migration-error.md
Created January 19, 2016 03:07
rails migration pg_dump: invalid option -- 'i'

If you start to see something like this, e.g. on Heroku since they installed the postgres 9.5 client libraries on their dynos

/usr/lib/postgresql/9.5/bin/pg_dump: invalid option -- 'i'
Try "pg_dump --help" for more information.
rake aborted!
Error dumping database
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.4/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `structure_dump'
@ethicalhack3r
ethicalhack3r / chrome-uri.txt
Last active February 20, 2024 03:02
Chrome 'protocol handlers' extracted from Google Chrome browser source code (chromium-50.0.2624.0.tar.xz downloaded from https://gsdview.appspot.com/chromium-browser-official/). A lot will not work, some are probably from unit tests.
chrome://-alkuisissa
chrome://-nettadresser
chrome://-webbadresser
chrome://ChromeTestChromeWebUIControllerFactory
chrome://DummyURL
chrome://URLs
chrome://about
chrome://accessibility
chrome://anything
chrome://app-list
@satya164
satya164 / class-properties-to-methods.js
Created January 8, 2016 18:17
Codemod to convert class methods to properties, and remove `.bind(this)` in JSX props
// Codemod to convert class methods to properties, and remove `.bind(this)` in JSX props.
// Doesn't support Flow annotations yet
export default function(file, api) {
const j = api.jscodeshift;
const convertToClassProps = p => {
const node = p.node;
if (node.key.name.indexOf('_') === 0) {
node.type = 'ClassProperty';