Skip to content

Instantly share code, notes, and snippets.

View palmerabollo's full-sized avatar

Guido García palmerabollo

View GitHub Profile
@Haprog
Haprog / deepQuerySelectorAll.js
Created May 5, 2021 08:36
A version of querySelectorAll() that also recursively looks into all shadow roots
/**
* A version of querySelectorAll() that also recursively looks into all shadow roots.
* @param selector Selector
* @param root (Optional) Scope of the query (Element or Document). Defaults to the document.
* @returns
*/
function deepQuerySelectorAll(selector, root) {
root = root || document;
const results = Array.from(root.querySelectorAll(selector));
const pushNestedResults = function (root) {
@kazusato
kazusato / building-falco-probe-driver-for-aks.md
Last active April 3, 2023 10:45
Building Falco probe driver for Azure AKS nodes

Background

Falco

Falco is an open source product for container runtime security.

https://falco.org/

Installation for Kubernetes

@imsus
imsus / sample.txt
Created February 6, 2019 10:13
Telegram Instant View Boilerplate
# This sample template explores how we can turn the Telegram blog post on the left into an Instant View page as shown on the right — in several simple steps. If you're unsure what some of the elements used here do, check out the full documentation here: https://instantview.telegram.org/docs
# Place the version at the beginning of template. We recommend always using the latest available version of Instant View.
~version: "2.0"
### STEP 1: Define which pages get Instant View and which don't
# That's easy because we only need IV pages for posts on the Telegram blog.
# This *condition* does the trick.
# ?path: /blog/.+
@steveosoule
steveosoule / wget--crawl.sh
Created May 31, 2017 17:05
Wget - Options & Sample Crawler
#!/bin/sh
# wget --mirror --adjust-extension --page-requisites --execute robots=off --wait=30 --rand om-wait --convert-links --user-agent=Mozilla http://www.example.com
### V1
# wget \
# --recursive \
# --no-clobber \
# --page-requisites \
# --html-extension \

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

var alter = require('../lib/alter.js');
var _ = require('lodash');
var Chainable = require('../lib/classes/chainable');
module.exports = new Chainable('movingstd', {
args: [
{
name: 'inputSeries',
types: ['seriesList']
},
{
@joar
joar / jq-insert-var.sh
Last active July 25, 2024 00:55
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@patio11
patio11 / ansible-snippet.yaml
Created July 9, 2015 02:44
Create an account on every box using the list of employees; initialize with their Github SSH keys
vars:
starfighters:
- username: patrick
github: patio11
name: "Patrick McKenzie"
- username: thomas
github: tqbf
name: "Thomas Ptacek"
- username: erin
github: boboTjones
@greuze
greuze / .grunt_bash_completion
Created June 4, 2015 15:31
Autocomplete grunt task if Gruntfile.js is present
# Create function that will run when a certain phrase is typed in terminal
# and tab key is pressed twice
_grunt_complete()
{
# fill local variable with a list of completions
local COMPLETES=`grep -s 'grunt\.registerTask' Gruntfile.js | sed "s/\s*grunt.registerTask('\([^']*\)',.*$/\1/g"`
# we put the completions into $COMPREPLY using compgen
COMPREPLY=( $(compgen -W "$COMPLETES" -- ${COMP_WORDS[COMP_CWORD]}) )
return 0
@kyledrake
kyledrake / ipfs-refs-daemon.sh
Last active August 18, 2019 18:00
IPFS replication service with one line of unix shell code!
#!/bin/bash
# First, install ncat: http://nmap.org/ncat/
# Usually comes with the 'nmap' package on distributions.
ncat -k -v -l -p 5555 -c 'ipfs refs local | gzip'
# To retrieve on the client machine:
# nc 127.0.0.1 5555 | gunzip | ipfs pin add -r