Skip to content

Instantly share code, notes, and snippets.

View johnnyasantoss's full-sized avatar
🤓
Learning

Johnny Santos johnnyasantoss

🤓
Learning
View GitHub Profile
@jean-lourenco
jean-lourenco / dapper.cs
Last active April 7, 2017 19:45
Exemplo de queries com o Dapper
public static void Main()
{
var paraCadastrar = new []
{
new { Chave = "CSVDEFAULT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "JSONDEFAULT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "YAML", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "INIT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "CONFIG", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "BSON", Descricao = "Descrição detalhada (ou não)" },
@mgravell
mgravell / Odd findings.txt
Last active April 19, 2017 10:39
async; ValueTask vs Task
Objective: compare Task<T> vs ValueTask<T> in a scenario that should
be ideal for ValueTask<T> - non-trivial results, but usually (always)
already completed.
Hypothesis: ValueTask<T> should be more efficient, as it does not (in
the "already completed" case) involve allocation.
Methodology: create a test rig that computes a number using multiple
nested roll-up operations, comparing sync vs async-Task<T> vs async-ValueTask<T>;
use "async"/"await" for the rollups in the async cases. Run all tests using
#/usr/bin/env bash
# Install some pacakages we'll need to compile the driver below.
sudo dnf install gcc kernel-devel -y
# Create working dir for Broadcom driver files and patches.
mkdir hybrid_wl_f23
# Change to working dir.
cd hybrid_wl_f23
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/
@PaulSec
PaulSec / certstream_watchdog_paypal.py
Created November 6, 2017 15:27
certstream utility to retrieve paypal and few other fraud keywords
import certstream
keywords = ['paypal', 'paypol']
def extract_domains(domains):
res = []
for domain in domains:
for keyword in keywords:
if keyword in domain:
res.append(domain)
@guilhermednt
guilhermednt / check_intermedium_private_key_leak.sh
Created May 9, 2018 23:08
Verifying Banco Intermedium's private key leak
# Today the twitter user @ayubio said he had received the private key for a Brazillian bank's HTTPS certificate:
# - https://twitter.com/ayubio/status/994260981294469120
# - https://twitter.com/ayubio/status/994262029929246722
# - https://twitter.com/ayubio/status/994277992351391744
# To prove he actualy had the key, another user asked him to sign a message with such key and so he did:
# - http://pastebin.xyz/p?q=bXllODA
# The commands bellow will check that signature
# Store the message in a file (tweet.txt) in the same way @ayubio did:
@claudiosanches
claudiosanches / install.sh
Last active September 3, 2021 15:48
Ubuntu - Install Strem.io
#!/usr/bin/env bash
sudo su
curl -SO# http://178.62.254.47/Stremio3.5.1.linux.tar.gz
mkdir -p /opt/stremio
tar -xvzf Stremio3.5.1.linux.tar.gz -C /opt/stremio
curl -SO# http://www.strem.io/3.0/stremio-white-small.png
mv stremio-white-small.png /opt/stremio/
curl -SO# https://gist.githubusercontent.com/claudiosmweb/797b502bc095dabee606/raw/52ad06b73d90a4ef389a384fbc815066c89798eb/stremio.desktop
mv stremio.desktop /usr/share/applications/
@toddmotto
toddmotto / *.md
Last active April 25, 2023 09:06
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
@laanwj
laanwj / blocktoimg.py
Last active January 31, 2024 11:06
tools to write (block) data to png files and vice versa
#!/usr/bin/env python3
# Distributed under the MIT software license
import binascii, struct, sys, io, argparse
from PIL import Image
IMG_WIDTH = 512 # could be made adaptive...
MIN_HEIGHT = 4 # minimum height of image; twitter won't let us upload anything smaller
BYTES_PER_PIXEL = 4 # RGBA, 8 bit
def div_roundup(x,y):
@RobinLinus
RobinLinus / covenants.md
Last active March 4, 2024 12:04
A collection of resources related to covenants