Skip to content

Instantly share code, notes, and snippets.

View anteriovieira's full-sized avatar
๐Ÿ 
Working from home

Antรฉrio Vieira anteriovieira

๐Ÿ 
Working from home
View GitHub Profile
@anteriovieira
anteriovieira / capitalize.js
Created September 21, 2021 12:32 — forked from xiCO2k/capitalize.js
Capitalize Helper
const capitalize = str => str.replace(/^\w|\s\w/g, char => char.toUpperCase());
@anteriovieira
anteriovieira / format-object.js
Created January 14, 2021 01:05 — forked from Akryum/format-object.js
Format a JS object or array to JavaScript source code string
const KEY_ESCAPE_REG = /[\s-.:|#@$ยฃ*%]/
const MAX_SINGLE_LINE_ARRAY_LENGTH = 3
export function formatObjectToSource (obj) {
return printLines(Array.isArray(obj) ? arrayToSourceLines(obj) : objectToSourceLines(obj))
}
function objectToSourceLines (object, indentCount = 0) {
return createLines(indentCount, lines => {
lines.push('{')
@anteriovieira
anteriovieira / gist:5aba12a3425f2d1737302df1f978e9aa
Created November 27, 2020 20:44 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@anteriovieira
anteriovieira / profile.js
Created November 28, 2017 22:18 — forked from ericelliott/profile.js
A good enough profile script to compare two versions of a fibonacci generator.
import iterativefib from 'iterativefib';
import memofib from 'memofib';
import range from 'test/helpers/range';
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
const profile = () => {
const numbers = 79;
const msg = `Profile with ${ numbers } numbers`;
@anteriovieira
anteriovieira / profile.js
Created November 28, 2017 22:18 — forked from ericelliott/profile.js
A good enough profile script to compare two versions of a fibonacci generator.
import iterativefib from 'iterativefib';
import memofib from 'memofib';
import range from 'test/helpers/range';
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
const profile = () => {
const numbers = 79;
const msg = `Profile with ${ numbers } numbers`;
@anteriovieira
anteriovieira / angularjs-providers-explained.md
Created May 12, 2017 00:34 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@anteriovieira
anteriovieira / gist:6cfb06ebc2844045682e97216fc368f0
Created March 24, 2017 13:08 — forked from hileon/gist:1311735
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 โ€“ Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@anteriovieira
anteriovieira / app.ts
Created February 24, 2017 14:47 — forked from scottmcarthur/app.ts
How to use AngularJS ng.resource.IResource with TypeScript.
/// <reference path="angular.d.ts" />
/// <reference path="angular-resource.d.ts" />
interface IEmployee extends ng.resource.IResource<IEmployee>
{
id: number;
firstName : string;
lastName : string;
}
interface IEmployeeResource extends ng.resource.IResourceClass<IEmployee>