Skip to content

Instantly share code, notes, and snippets.

Avatar
👀

Erick Delfin Nifled

👀
  • Nearsoft
  • Sonora, Mexico
View GitHub Profile
@Nifled
Nifled / app.ts
Created May 8, 2019
Getter/Setters with ES5/ES6 in TypeScript
View app.ts
// ES5
var Element = (function() {
function Element() {
this._class = null;
}
Object.defineProperty(Element.prototype, 'className', {
get: function() {
return this._class;
},
set: function(name) {
@Nifled
Nifled / css.json
Created Oct 22, 2018
styled-components vscode custom snippets
View css.json
{
"Styled Component Media Query": {
"prefix": "media",
"body": [
"@media ($1-width: $2) {",
"\t$0",
"}"
],
"description": "Media Query"
},
@Nifled
Nifled / css.json
Created Oct 22, 2018
styled-components vscode custom snippets
View css.json
{
"Styled Component Media Query": {
"prefix": "media",
"body": [
"@media ($1-width: $2) {",
"\t$0",
"}"
],
"description": "Media Query"
},
@Nifled
Nifled / javascriptreact.json
Last active Oct 19, 2018
React ES6 custom snippets for vscode
View javascriptreact.json
{
"Import React": {
"prefix": "imr",
"body": ["import React from 'react'"],
"description": "Import React"
},
"Import PropTypes": {
"prefix": "impt",
"body": ["import PropTypes from 'prop-types'"],
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@Nifled
Nifled / App.js
Last active Aug 22, 2018
React Redux protected routes
View App.js
const App = ({ location, isAuthenticated }) => (
<div className='ui container'>
{ isAuthenticated && <TopNavigation /> }
<Route location={location} path='/' exact component={HomePage} />
<Route location={location} path='/confirmation/:token' exact component={ConfirmationPage} />
<UserRoute location={location} path='/dashboard' exact component={DashboardPage} />
<UserRoute location={location} path='/books/new' exact component={NewBookPage} />
View .aliases
alias gs="git status"
alias gaa="git add -A"
alias gpush="git push origin master"
alias gpull="git pull origin master"
alias gcm="git commit -m"
alias ls="tree -L 1"
alias ls2="tree -L 2"
alias la="tree -a -L 1"
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
@Nifled
Nifled / .eslintrc
Created May 19, 2018
my eslint config - i don't like semicolons
View .eslintrc
// install the following packages:
// yarn add --dev eslint prettier eslint-config-airbnb@^15.0.1 eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y@^5.1.1
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2016,
"sourceType": "module",
@Nifled
Nifled / script.sh
Created Apr 17, 2018
Bash script to change author on all commits in repo (run inside repo)
View script.sh
#!/bin/sh
git filter-branch --env-filter '
# Replace info here --------------------------------------
OLD_EMAIL="root@TARS2000.localdomain"
CORRECT_NAME="Erick Delfin"