- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
| function useTaskQueue(params: { | |
| shouldProcess: boolean | |
| }): { | |
| tasks: ReadonlyArray<Task> | |
| isProcessing: boolean | |
| addTask: (task: Task) => void | |
| } { | |
| const [queue, setQueue] = React.useState<{ | |
| isProcessing: boolean | |
| tasks: Array<Task> |
| #!/bin/bash | |
| sudo apt-get install -y devilspie | |
| mkdir -p ~/.devilspie | |
| echo ' | |
| (if (contains (window_class) "Code") | |
| (begin | |
| (spawn_async (str "xprop -id " (window_xid) " -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 ")) | |
| (spawn_async (str "xprop -id " (window_xid) " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xD8000000")) |
| #!/bin/bash | |
| function get_active_window() { | |
| printf "0x%08x" $(xdotool getactivewindow) | |
| } | |
| function get_current_opacity() { | |
| window="$1" | |
| opacity=$(xprop -id $window | grep _NET_WM_WINDOW_OPACITY | awk '{print $3}') | |
| if [ -z $opacity ]; then |
| #!/bin/bash | |
| # Change to the script's directory & create directory | |
| cd $(dirname "$(readlink -f "$0")") | |
| mkdir -p ./dbdumps | |
| # Load database name + root password | |
| source .env | |
| # Check if variables were provided |
brew install cuetools flac ffmpeg shntool
$ shnsplit -o flac -f file.cue file.flac
| const http = require('http'); | |
| const server = http.createServer(); | |
| server.on('request', (request, response) => { | |
| let body = []; | |
| request.on('data', (chunk) => { | |
| body.push(chunk); | |
| }).on('end', () => { | |
| body = Buffer.concat(body).toString(); |
| class Logger { | |
| constructor() { | |
| if (!Logger.instance) { | |
| Logger.instance = this; | |
| } | |
| return Logger.instance; | |
| } | |
| log(...args) { | |
| console.log(...args); |
| # Instructions for 4.14 and cuda 9.1 | |
| # If upgrading from 4.13 and cuda 9.0 | |
| $ sudo apt-get purge --auto-remove libcud* | |
| $ sudo apt-get purge --auto-remove cuda* | |
| $ sudo apt-get purge --auto-remove nvidia* | |
| # also remove the container directory direcotory at /usr/local/cuda-9.0/ | |
| # Important libs required with 4.14.x with Cuda 9.X | |
| $ sudo apt install libelf1 libelf-dev |