Skip to content

Instantly share code, notes, and snippets.

View crash7's full-sized avatar
:octocat:
Hopefully learning something new.

Christian Musa crash7

:octocat:
Hopefully learning something new.
  • Stockholm, Sweden
View GitHub Profile
@crash7
crash7 / DemoContext.jsx
Created April 8, 2018 20:42
Playing with the new React Context API
/**
* This a very small example of a HoC that used the new react context API that can be used to save a
* state globally without using any state library.
*
* This is a toy gist just to demo what you can do, please don't copy & paste the code without reading:
* https://reactjs.org/docs/context.htmt
*/
import React, { PureComponent } from 'react';
const defaultContextValue = {
@crash7
crash7 / rewrite-git-message-by-commit-hash
Created August 22, 2015 01:40
Rewrite git message for specifics commits
git filter-branch -f --msg-filter '
read commit
declare -A commits_replaces;
commits_replaces["<commit hash>"]="new message"
if [[ ${commits_replaces[$GIT_COMMIT]} ]]; then
echo ${commits_replaces[$GIT_COMMIT]};
else
echo $commit
fi' -- --all
@crash7
crash7 / replicate-scdn-locally.md
Last active August 29, 2015 14:23
Replicate secure cdn using a normal cdn as fallback

Replicate secure cdn using a normal cdn as fallback

1- Install http-server nodejs module

sudo npm install -g http-server

2- Create a folder for your files

mkdir replicated-cdn