Skip to content

Instantly share code, notes, and snippets.

View lautapercuspain's full-sized avatar
:octocat:
I'm a cool octocat

Lautaro Gruss lautapercuspain

:octocat:
I'm a cool octocat
View GitHub Profile
@lautapercuspain
lautapercuspain / git-clearHistory
Created June 20, 2021 01:09 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@lautapercuspain
lautapercuspain / repo-reset.md
Created June 20, 2021 01:09 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@lautapercuspain
lautapercuspain / store.js
Created January 13, 2021 22:38
No More Redux Por Favor
// store.js
import React, {createContext, useReducer} from 'react';
const initialState = {};
const store = createContext(initialState);
const { Provider } = store;
const StateProvider = ( { children } ) => {
const [state, dispatch] = useReducer((state, action) => {
switch(action.type) {
$stderr.write 'Press enter to continue'
$stdin.gets
@lautapercuspain
lautapercuspain / terminal-git-branch-name.md
Created November 22, 2019 18:08 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@lautapercuspain
lautapercuspain / 0_reuse_code.js
Created February 10, 2016 19:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lautapercuspain
lautapercuspain / gist:4f0ff248e21729c386ef
Created July 28, 2014 20:37
vip quickstart error log
_ __(_)___ ____ ___ __(_)____/ /_______/ /_____ ______/ /_
| | / / / __ \ / __ `/ / / / / ___/ //_/ ___/ __/ __ `/ ___/ __/
| |/ / / /_/ / / /_/ / /_/ / / /__/ ,< (__ ) /_/ /_/ / / / /_
|___/_/ .___/ \__, /\__,_/_/\___/_/|_/____/\__/\__,_/_/ \__/
/_/ /_/
==================================
@lautapercuspain
lautapercuspain / layout.html.erb
Created August 24, 2012 17:35 — forked from joho/layout.html.erb
Doing custom facebook JS api stuff while loading their API async (from the layout).
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
status : true, // check login status
});
// check if the view has registered an "after facebook load callback"
if(typeof window.appSpecificFbAsyncInit == 'function') {