Skip to content

Instantly share code, notes, and snippets.

View eduzera's full-sized avatar
😀

Eduardo Zaghi eduzera

😀
View GitHub Profile
@EduVencovsky
EduVencovsky / Auth.jsx
Last active February 20, 2024 03:28
Private Routes with Auth using react-router and Context API
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { checkIsAuthenticated, authSignUp, authLogin, authLogout } from '../../services/auth'
export const AuthContext = React.createContext({})
export default function Auth({ children }) {
const [isAuthenticated, setIsAuthenticated] = useState(false)
const [isLoading, setIsLoading] = useState(true)
@wbotelhos
wbotelhos / libreadline_6_not_found.sh
Created November 29, 2016 20:42
Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
ESTADOS_BRASILEIROS = [
["Acre", "AC"],
["Alagoas", "AL"],
["Amapá", "AP"],
["Amazonas", "AM"],
["Bahia", "BA"],
["Ceará", "CE"],
["Distrito Federal", "DF"],
["Espírito Santo", "ES"],
["Goiás", "GO"],
@caseywatts
caseywatts / MediawikionHeroku.md
Last active August 16, 2022 06:28
Mediawiki on Heroku
@koriroys
koriroys / coffee-asset-pipeline-comments.js
Last active January 17, 2020 11:20
convert all coffeescript files to javascript
var fs = require('fs'),
os = require('os'),
lineReader = require('line-reader');
function help(){
console.log('Usage: node coffee-asset-pipeline-comments.js file1.coffee');
}
function compilefile(pathname, outdir){
var src = '';
@doxavore
doxavore / gist:3722096
Created September 14, 2012 14:07
Convert all CoffeeScript files to JavaScript

Is this really necessary? It seems like a bit of work...

In Vim, make all comments stick:

:arg **/*.js.coffee
:argdo %s/^\(\s*\)#/\1#!/ge

Compile from CoffeeScript to JavaScript (npm install -g coffee-script):

@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/