Capture a video of a given X Window with gstreamer.
xwininfo
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
from django.core.files.storage import default_storage | |
from django.core.files.base import ContentFile | |
file = request.FILES['your_file_fieldname'] | |
path = default_storage.save('heart_of_the_swarm.txt', ContentFile(file.read())) | |
#https://twigstechtips.blogspot.com/2012/04/django-how-to-save-inmemoryuploadedfile.html |
// Lists of countries with ISO 3166 codes, presented in various formats. | |
// Last Updated: July 30, 2020 | |
// If you're using PHP, I suggest checking out: | |
// https://github.com/thephpleague/iso3166 | |
// or Laravel: https://github.com/squirephp/squire | |
// | |
// JS developers can check out: | |
// https://www.npmjs.com/package/iso3166-2-db | |
// |
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
*nix
based command prompt (but not the default Windows Command Prompt!)cd ~/.ssh
. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\
on Windows).ssh
folder, there should be these two files: id_rsa
and id_rsa.pub
. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls
to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa
and id_rsa.pub
in order for Git, GitHub, and BitBucket to recognize them by default.ssh-keygen -t rsa -C "your_email@example.com"
. ThIf you press the "f" key in normal mode, Vim will move the cursor forward to whatever character you input after "f" is pressed. As an example, consider the following line: | |
a quick brown fox | |
If the cursor was at the absolute beginning of the line, and you pressed "fb" in normal mode, Vim would move the cursor so that it was positioned over the "b" in "brown". | |
If you press "F", Vim will move the cursor backwards instead of forward. Given the previous sentence, if pressed "Fq", and the cursor was at the end of the line, it would move to the "q" in "quick". |
require 'rubygems' | |
require 'yaml' | |
# A demonstration of YAML anchors, references and handling of nested values | |
# For more info, see: | |
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
stooges = YAML::load( File.read('stooges.yml') ) | |
# => { | |
# "default" => { |
<template> | |
<div | |
ref="componentRef" | |
class="general-style" | |
> | |
</div> | |
</template> | |
<script> | |
import useDetectOutsideClick from '/useDetectOutsideClick' |
function hexToHSL(hex) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
r = parseInt(result[1], 16); | |
g = parseInt(result[2], 16); | |
b = parseInt(result[3], 16); | |
r /= 255, g /= 255, b /= 255; | |
var max = Math.max(r, g, b), min = Math.min(r, g, b); | |
var h, s, l = (max + min) / 2; | |
if(max == min){ | |
h = s = 0; // achromatic |
Vue events don't bubble the component tree on their own. However when writing wrapper components this can be the desired behaviour.
This code registers a global bubble
directive which allows to re-emit all given events:
Let's say we want to bubble events start
, accelerate
and brake
of our component Car
.
Without any help, we'd roughly have to do this: