Skip to content

Instantly share code, notes, and snippets.

View akshayjai1's full-sized avatar

Akshay Vijay Jain akshayjai1

View GitHub Profile
@TBonnin
TBonnin / git-remove-branches
Last active May 27, 2023 14:44
Safely remove local fully merged branches
#!/bin/bash
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
@lopspower
lopspower / README.md
Last active May 24, 2024 10:48
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@gaearon
gaearon / connect.js
Last active April 11, 2024 06:46
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@tomysmile
tomysmile / mac-setup-redis.md
Last active May 23, 2024 03:17
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@rhernandog
rhernandog / index.jsx
Last active December 17, 2020 14:53
React & Recompose withProps - A simple example of using recompose's withProps
// styles for this are based on Bootstrap 3.3.7
import React, { Component } from "react";
import ReactDOM from "react-dom";
import { withProps } from "recompose";
const users = [
{ "name": "Homer Jay", "status": "pending" },
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@ibraheem4
ibraheem4 / postgres-brew.md
Last active May 20, 2024 07:49 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@divyanshu013
divyanshu013 / code.settings
Last active May 21, 2020 02:18
My VSCode settings
{
"vscode_custom_css.imports": [
"file:///Users/divyanshu/.vscode/style.css"
],
"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"javascript.validate.enable": false,
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
"editor.multiCursorModifier": "ctrlCmd",
"workbench.startupEditor": "newUntitledFile",