Skip to content

Instantly share code, notes, and snippets.

View posva's full-sized avatar
🙏
sponsor me on GitHub

Eduardo San Martin Morote posva

🙏
sponsor me on GitHub
View GitHub Profile

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@aarmea
aarmea / animatronic_mouth.py
Last active July 20, 2023 23:46
Open and close an animatronic mouth on a Raspberry Pi GPIO pin
#!/usr/bin/env python
"""
animatronic_mouth.py
This script animates a motorized mouth on a Raspberry Pi GPIO pin so that it
appears to be speaking alongside the audio on the specified PulseAudio source
(which usually should be a sink's monitor).
Find PA_SOURCE with `pactl list` and look for a monitor device that corresponds
const marky = require('marky')
const render = Vue.prototype._render
const update = Vue.prototype._update
const camelize = str => str && Vue.util.camelize(str)
function getName (vm) {
if (!vm.$parent) return 'root'
return (
camelize(vm.$options.name) ||
camelize(vm.$options._componentTag) ||
@Rich-Harris
Rich-Harris / please-include-a-repro.md
Last active December 18, 2023 15:01
Please include a repro

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Node versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and I

@mbijon
mbijon / disable-xss-auditor.sh
Created September 19, 2016 19:04
CLI command to start Chrome with XSS Auditor disabled. Use for XSS/security testing
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --disable-xss-auditor --enable-devtools-experiments --disable-features=enable-automatic-password-saving
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0
@posva
posva / quote
Created May 17, 2013 19:45
Color formatted code for zsh (may work in other terminals) to display a random quote from http://www.quotationspage.com/random.php3
#! /bin/zsh
Q=$(curl -s "http://www.quotationspage.com/random.php3" | grep -m 1 "dt ")
TXT=$(echo "$Q" | sed -e 's/<\/dt>.*//g' -e 's/.*html//g' -e 's/^[^a-zA-Z]*//' -e 's/<\/a..*$//g')
W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
echo "\e[0;33m${W}\033[0\e[0;30m: \e[0;35m“${TXT}”\e[m"
@banaslee
banaslee / XGH - en.txt
Last active March 26, 2024 23:36
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).