Skip to content

Instantly share code, notes, and snippets.

View jonathborg's full-sized avatar
🏠
Working from home

Joe jonathborg

🏠
Working from home
View GitHub Profile
// https://askubuntu.com/a/51953
// If you want all new files in a particular directory to be owned by a particular group, just apply the setgid bit on it:
chmod -R 755 /some/dir
chgrp www-data /some/dir
chmod g+s /some/dir
// If you have an existing tree of directories that you want to apply this behaviour to, you can do so with find:
import React, { useEffect, useRef, useState } from 'react'
import * as Ladda from 'ladda'
import '../../../node_modules/ladda/css/ladda.scss'
export default function LaddaButton(props) {
const buttonEl = useRef(null)
const [laddaButton, setLaddaButton] = useState(null)
useEffect(() => {
import React from 'react';
export default function App() {
const Form = ({ validationSchema, ...props }) => {
function recursiveMap(children, fn) {
return React.Children.map(children, child => {
if (!React.isValidElement(child)) {
return child;
[Desktop Entry]
Name=Spark
Version=2.7.7
GenericName=Spark
X-GNOME-FullName=Spark
Comment=ignite realtime Spark IM client
Type=Application
Categories=Application;Utility;
Path=/opt/spark
Exec=/opt/spark/Spark
PROMPT_DIRTRIM=3
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "
// https://askubuntu.com/a/51953
// If you want all new files in a particular directory to be owned by a particular group, just apply the setgid bit on it:
chgrp www-data /some/dir
chmod g+s /some/dir
// If you have an existing tree of directories that you want to apply this behaviour to, you can do so with find:
find /some/dir -type d -exec chgrp www-data {} +
code --install-extension ms-vscode.sublime-keybindings
code --install-extension msjsdiag.debugger-for-chrome
code --install-extension PeterJausovec.vscode-docker
code --install-extension PKief.material-icon-theme
code --install-extension redhat.vscode-yaml
code --install-extension Shan.code-settings-sync
code --install-extension william-voyek.vscode-nginx
sudo find . -name "node_modules" -type d -prune | xargs du -chs
sudo find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
- Spark Chat
O spark a partir da versão 2.8 usa um protocolo de transferência de arquivo diferente, na porta 7777. Para funcionar basta baixar a versão 2.7.7 encontrada nesse link: https://github.com/igniterealtime/Spark/releases/tag/v2.7.7
Baixe a versão .tar.gz, é requerido o java8 na máquina. Para instalar:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
tar -xvzf spark_2_7_7.tar.gz
## List folder sizes sorted asc
du -sh ./* | sort -h
## Remove folders/files based on .gitignore
for f in ./* ./**/*
do
if [ -d "$f" ] && [ -d "$f/.git" ]
then
echo "Directory $f"
git --git-dir $f/.git clean -Xdf -e !.env* -- $f