Skip to content

Instantly share code, notes, and snippets.

View jhonnymoreira's full-sized avatar

Jhonny Moreira jhonnymoreira

View GitHub Profile
export function add(x: number, y: number): number
export function subtract(x: number, y: number): number
rows = [
[9, 0, 5, 0, 0, 8, 0, 0, 2],
[0, 0, 8, 0, 0, 0, 5, 0, 0],
[0, 4, 0, 0, 3, 5, 0, 6, 9],
[4, 0, 3, 7, 0, 2, 0, 0, 0],
[0, 0, 7, 0, 4, 0, 2, 0, 0],
[0, 0, 0, 3, 0, 9, 6, 0, 4],
[2, 8, 0, 4, 9, 0, 0, 1, 0],
[0, 0, 9, 0, 0, 0, 4, 0, 0],
[5, 0, 0, 8, 0, 0, 7, 0, 6]

Vue Learning

Directives

Special attributes provided by Vue, which applies reactive behavior to the rendered DOM.

Each directive is prefixed with a v-. Here a list of all directives:

Conditional Directives

@jhonnymoreira
jhonnymoreira / dig.js
Last active May 12, 2017 19:25
An oneliner dig function for JavaScript.
/**
* @function
*
* Returns the value of a path to be found within an object.
*
* @param {Object} [from] The object to search
* @param {Array} [path] The path to search within object
*
* @return {*} The value from path search
*/
@jhonnymoreira
jhonnymoreira / XMLHttpRequest.js
Created April 20, 2017 14:22
A few JavaScript Patterns with opinionated code based on Stoyan Stefanov's book: JavaScript Patterns
const request = new XMLHttpRequest
const URL = 'https://google.com.br'
// `async` by default, since the last function param is ommited
request.open('GET', URL)
request.send()
// use `load` instead of `ready` so there is no need to do more checks
// related to status code and stuff
request.addEventListener('load', handleResponse)
" No compatibility with `vi`
set nocompatible
set encoding=utf-8
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
" Plugins and Bundles used
call vundle#begin()
@jhonnymoreira
jhonnymoreira / heu_fz_01
Created January 22, 2017 08:54
Hacker Evolution: Untold [DLC: Flight Zero] - Level: Intrusion
crack gate.wxt-airport.com 900
decrypt gate.wxt-airport.com
connect gate.wxt-airport.com 900
download backdoor_901.exploit
logout
exec backdoor_901.exploit gate.wxt-airport.com
connect gate.wxt-airport.com 901
@jhonnymoreira
jhonnymoreira / gulpfile.js
Last active December 19, 2016 22:40
Code to start and optimize a new project.
var gulp = require('gulp')
var plumber = require('gulp-plumber')
var eslint = require('gulp-eslint')
var pug = require('gulp-pug')
var stylus = require('gulp-stylus')
var cssnano = require('gulp-cssnano')
var uglify = require('gulp-uglify')
var autoprefixer = require('gulp-autoprefixer')
var imagemin = require('gulp-imagemin')
var browserSync = require('browser-sync').create()
@jhonnymoreira
jhonnymoreira / dotfiles.sh
Last active December 24, 2016 08:41
A study with Shell Script to rename and create dotfiles symlinks.
#!/bin/bash
blacklisted () {
blacklist=('LICENSE' 'README.md' 'dotfiles.sh')
for ((i = 0; i < ${#blacklist[@]}; i++))
do
if [ $1 == ${blacklist[$i]} ]
then
return 0