Skip to content

Instantly share code, notes, and snippets.

@shotaK
shotaK / context.ts
Last active December 10, 2021 08:54
Typescript React Context
// Create context
import { createContext } from 'react';
export type ExampleContext = {
someFunction?: (arg) => void;
someProperty?: string[];
};
export default createContext<ExampleContext>(null);
@shotaK
shotaK / keybindings.json
Created November 3, 2021 11:41
VsCode mouse up/down macros
{
"key": "ctrl+up",
"command": "cursorMove",
"args": {
"to": "up",
"by": "line",
"value": 4
},
"when": "editorTextFocus"
},
@shotaK
shotaK / gist:e929e754a2f7e73e7376e874fbb59fc8
Created September 22, 2021 11:01
Github clone origination url
git clone [email protected]:companyName/repoName
1) Edit: ~/.ssh/config
2) Add:
Host gitlab.com-companyName
HostName gitlab.com
User [email protected]
IdentityFile ~/.ssh/id_ed25519_companyName
3) Clone the repo:
@shotaK
shotaK / config
Created November 1, 2020 09:05
fish shell improved ls
alias ls='ls -lhX --classify --color=auto --group-directories-first'
funcsave ls
@shotaK
shotaK / Log context in terminal
Created June 14, 2018 19:22
Bigcommerce/Stencil/Handlebars
{{log this}}
@shotaK
shotaK / checkbox.css
Last active January 12, 2018 12:14
Checkbox Styling
.remember-me__title {
float: left;
}
.remember-me input {
visibility: hidden;
opacity: 0;
float: left;
position: absolute;
}
.remember-me input:checked + span {
@Component({
template: `
<my-widget>
<comp-a/>
</my-widget>
`
})
class App {}
@Component({
export default function reducer(state=initialState, action) {
switch(action.type) {
case defs.MAKE_PAYMENT_SUCCESS:
return state.withMutations(s =>
s.set('modalOpen', false)
.set('loading', false)
.setIn(['loans', action.loan.id], Immutable.fromJS(action.loan))
)
case defs.MAKE_PAYMENT_FAILED:
return state.withMutations(s =>
@shotaK
shotaK / createAsyncAction.js
Last active October 2, 2017 17:40
Abstracting async actions.
import { createAction } from 'redux-actions';
/**
* Creates an async action creator
*
* @param {String} TYPE the type of the action
* @param {Function} executeAsync the function to be called async
* @return {Funtion} the action creator
*/
export default function createAsyncAction(TYPE, executeAsync) {