Skip to content

Instantly share code, notes, and snippets.

View danielnass's full-sized avatar
🚀
Ship it!

Daniel Nass danielnass

🚀
Ship it!
View GitHub Profile
// @flow
import * as React from 'react';
import Mixpanel from 'utils/mixpanel';
import * as Sentry from 'utils/sentry';
import client from '../apolloClient';
import { MIXPANEL_TRACKS } from '../constants';
import { SidebarButton } from '../components/Inner/SidebarButton';
import { actionsIntoSlugs } from '../../InAppHelpSidebar/helpers/actionsIntoSlugs';
import type { Props as Slugs } from '../../InAppHelpSidebar/helpers/actionsIntoSlugs';
#!/bin/bash
while $@; do :; done
@danielnass
danielnass / vue-lifecycle.js
Created June 28, 2019 01:40
All Vue Lifecycles
beforeCreate() {
console.log(this, 'beforeCreate');
},
created() {
console.log(this, 'created');
},
beforeMount() {
console.log(this, 'beforeMount');
},
mounted() {

touch ~/.hushlogin

@danielnass
danielnass / .bash_profile
Last active July 18, 2019 02:28
bash profile
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
if [ -f "/usr/local/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR="/usr/local/opt/bash-git-prompt/share"
source "/usr/local/opt/bash-git-prompt/share/gitprompt.sh"
fi
whoami() {
echo -e "\nYou are logged on ${RED}$HOST"
echo -e "\nAdditionnal information:$NC " ; uname -a
@danielnass
danielnass / colors.js
Last active January 21, 2018 20:48
EBANX Colors Palette
export const Colors = {
ebanxPallete: {
sky: {
deep: '#09285B',
darker: '#124D84',
dark: '#1A72AC',
medium: '#2397D4',
light: '#5AB1DF',
lighter: '#91CBEA',
bright: '#E9F4FA',
@danielnass
danielnass / cards.js
Created June 15, 2017 22:03
Credit Card Types Array
cards = [
{
type: 'amex',
pattern: /^3[47]/,
format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
length: [15],
cvcLength: [4],
luhn: true
}, {
type: 'dankort',
@danielnass
danielnass / terminal.md
Created May 25, 2016 00:22
Basic Terminal

Some commands can be found in the bin directory.

ls - list files
ls -a - display hidden files and folders
ls -R - provide a tree listing of directory structure.
ls -l - displays extra details like size, user, date, permissions

cd <path> -> change directory
(cd .. -> takes to parent directory
cd -> takes to user directory[denoted by ~]

// For a full list of event types: https://developer.mozilla.org/en-US/docs/Web/API/document.createEvent
var el = document.getElementById('olar'),
eBlur = document.createEvent('HTMLEvents');
eBlur.initEvent('blur', true, false);
el.dispatchEvent(eBlur);
@danielnass
danielnass / gist:d41d47a9b6e05918a56c
Created February 5, 2015 21:46
jQuery Validation Additional Method CNH - Carteira Nacional de Habilitação - Carteira de Motorista
$.validator.addMethod('CNH', function(value, element) {
var ret,
cnh = value,
firstChar = cnh.charAt(0);
if (cnh.replace(/[^\d]/g, '').length === 11 && firstChar.repeat(11) !== cnh) {
var dsc = 0;
for (var i = 0, j = 9, v = 0; i < 9; ++i, --j) {