# Show ignored files
git status --ignored
# Show help
git help command
# Grep only tracked files
git grep -e "pattern"
# Grep only tracked files with extension
#!/usr/bin/env python3 | |
''' Mavlink telemetry (.tlog) file parser. | |
Operates as a generator. Allows csv output or listing useful types/fields. | |
''' | |
import json | |
from pathlib import Path | |
from fnmatch import fnmatch | |
from pymavlink import mavutil |
from builtins import object | |
import weakref | |
from time import sleep | |
from threading import Thread, Event, Lock | |
from pymavlink import mavutil | |
import pymavlink.dialects.v20.ardupilotmega as mavlink | |
class WriteLockedFile(object): |
#!/usr/bin/env python3 | |
def parse(file): | |
''' Generates encoded characters from file byte data. | |
Encoding is suitable for embedded [Graphics] in SubStation Alpha files. | |
See here for encoding specification and other details: | |
http://www.tcax.org/docs/ass-specs.htm | |
Bytes are split into groups of 6 bits, then 33 is added to each group |
#!/usr/bin/env bash | |
keys=( $(pylint $(git ls-files '*.py') | rg '.*py:\d+:\d+: (.*):.*' -r '$1' | sort | uniq) ) | |
msgs=( $(pylint --list-msgs | rg ":(.*) \(([A-Z]\d+)\).*" -r '$1,$2' | sort) ) | |
for msg in "${msgs[@]}"; do | |
for key in "${keys[@]}"; do | |
if [[ $msg == *"$key" ]]; then | |
echo "${msg::-5}" | |
fi | |
done |
""" | |
Lyle Scott, III // lyle@ls3.io | |
Multiple ways to rotate a 2D point around the origin / a point. | |
Timer benchmark results @ https://gist.github.com/LyleScott/d17e9d314fbe6fc29767d8c5c029c362 | |
""" | |
from __future__ import print_function | |
import math |
function telefone_validation(telefone) { | |
//retira todos os caracteres menos os numeros | |
telefone = telefone.replace(/\D/g, ''); | |
//verifica se tem a qtde de numero correto | |
if (!(telefone.length >= 10 && telefone.length <= 11)) return false; | |
//Se tiver 11 caracteres, verificar se começa com 9 o celular | |
if (telefone.length == 11 && parseInt(telefone.substring(2, 3)) != 9) return false; |
#!/usr/bin/env python | |
# coding: utf-8 | |
from os import system | |
PROJECT_PATH = 'path_to_your_project' | |
ACTIVATE_VENV = '. path_to_your_virtualenv/bin/activate' | |
def tmux(command): |
Because pointers can be ugh
To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".
When declaring a variable by identifier (or name), the variable is synonymous with its value.
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't