This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from 'react'; | |
export const useFetch = (url: string) => { | |
const [data, setData] = useState(''); | |
const [loading, setLoading] = useState(false); | |
useEffect(() => { | |
if (url !== '') { | |
setData(''); | |
setLoading(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
mongo: | |
image: mongo | |
ports: | |
- 27017:27017 | |
volumes: | |
- ./data-db:/data/db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open the playlist page on google music | |
// open js console | |
// paste the code bellow | |
// go to http://playlist-converter.net | |
// use convert from plain text with the result of the script | |
// profit | |
// repeat | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function log_exec() | |
{ | |
$stack = json_encode(debug_backtrace(), JSON_PRETTY_PRINT) . "\n\n"; | |
file_put_contents('/tmp/log.txt', $stack, FILE_APPEND); | |
} | |
function middle_func() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>VueJS simplest todo ever</title> | |
<script src="https://unpkg.com/vue"></script> | |
</head> | |
<body> | |
<div id="app"> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$script = <<SCRIPT | |
apt-get update | |
apt-get install sudo | |
gpasswd -a vagrant sudo | |
echo "mysql-server mysql-server/root_password password password" | debconf-set-selections | |
echo "mysql-server mysql-server/root_password_again password password" | debconf-set-selections | |
apt-get -y install mysql-server | |
sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Teamspeak Service | |
After=network.target | |
[Service] | |
WorkingDirectory=/opt/teamspeak3-server_linux_amd64 | |
ExecStart=/opt/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh | |
ExecStop=/opt/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop | |
ExecReload=/opt/teamspeak3-server_linux_amd64/ts3server_startscript.sh restart | |
PIDFile=/opt/teamspeak3-server_linux_amd64/ts3server.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change the 'filename.ext' part and run | |
git filter-branch -f --index-filter "git rm -r --cached --ignore-unmatch filename.ext" --tag-name-filter cat -- --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printf "\nBlowing up your hard drive... please wait.\n" | |
printf "\nWriting:\n" | |
dd if=/dev/zero of=testfile bs=1024k count=512 | |
printf "\nReading:\n" | |
dd if=testfile of=/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# keybind: { "keys": ["ctrl+d"], "command": "exec", "args": { "cmd": ["/home/luan/scripts/sublime-refresh-browser.sh"]} } | |
xdotool search --onlyvisible --class "chromium" windowfocus key ctrl+r | |
xdotool search --onlyvisible --class "sublime-text" windowfocus |