Skip to content

Instantly share code, notes, and snippets.

View johinsDev's full-sized avatar

Johan Villamil johinsDev

  • Colombia
View GitHub Profile
@johinsDev
johinsDev / editor.js
Created December 7, 2022 04:21 — forked from chetan/editor.js
simple react sandbox playground
import {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup"
import {javascript} from "@codemirror/lang-javascript"
const jscode=`
// Note:
// 1. Use React.something instead of importing something
// 2. Container id is 'app'
function Counter({initialCount}) {
@johinsDev
johinsDev / reanimated-shared-element-gallery.tsx
Created January 20, 2021 17:39 — forked from nandorojo/reanimated-shared-element-gallery.tsx
React Native Reanimated v2 Shared Element Transition Image Gallery
@johinsDev
johinsDev / audit_mixin.py
Created June 27, 2020 14:27 — forked from mjhea0/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
@johinsDev
johinsDev / init.vim
Created November 12, 2019 17:42 — forked from benawad/init.vim
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@johinsDev
johinsDev / Install this packages.sh
Last active September 11, 2019 21:10
TEST React native Config with expo/typescript/react-native-testing-library
yarn add -D react-dom @testing-library/react-native @types/jest jest react-test-renderer @types/react-test-renderer jest-expo ts-jest
@johinsDev
johinsDev / .vimrc
Created August 1, 2019 00:20
vim config (prettier,theme,find files,eslint--> js, jsx)
set nocompatible " be iMproved, required
filetype off " required
set shell=bash " use bash for install plugins
set clipboard=unnamedplus " Using the clipboard as the default register
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('/some/path/here')
@johinsDev
johinsDev / README.md
Created July 30, 2019 19:29 — forked from imranismail/README.md
Ecto Soft Delete

Soft Delete Ecto Repo

The goal is to support soft delete functionality in Ecto.Repo. With the suggestion by @imranismail, another repo is created and the remaining functionalities are delegate to the original MyApp.Repo.

The new repo get/2 and all/1 functions will exclude the soft deleted record by default. delete/1 and delete_all/1 will update the delete_at column by default instead of deleting.

Example

MyApp.Repo.get(MyApp.User, 1) //will return nil if record is in soft delete state
@johinsDev
johinsDev / providerCompose.js
Created July 8, 2019 15:50 — forked from stolinski/providerCompose.js
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}
@johinsDev
johinsDev / .settings.json
Created June 17, 2019 16:54
Settings basic for visual studio code
{
"terminal.integrated.fontFamily": "Meslo LG M for Powerline",
"terminal.integrated.fontSize": 12,
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"explorer.openEditors.visible": 0,
"editor.quickSuggestions": {
"other": true,