Skip to content

Instantly share code, notes, and snippets.

View nicholasess's full-sized avatar
🎯
Focusing

Nicholas Eduardo nicholasess

🎯
Focusing
View GitHub Profile
@JoelBesada
JoelBesada / sketch-loader.js
Created January 8, 2018 15:10
Webpack Sketch Loader
const JSZip = require('jszip')
const { parseBuffer } = require('bplist-parser')
const { isObject, each, find } = require('lodash')
const parseArchivedValue = value => {
return parseBuffer(new Buffer(value, 'base64'))
}
const parseArchivedString = obj => {
const { $objects } = parseArchivedValue(
@mxstbr
mxstbr / Field.js
Last active February 23, 2022 07:39 — forked from hungrysquirrel/Field.js
Style Storybook with Styled Components
import React, { PropTypes } from 'react';
import styled from 'styled-components'
const Wrapper = styled.div`
// styles here that used to be for .test
`
const Label = styled.label`
// label styles here
`
@primaryobjects
primaryobjects / commit.png
Last active May 31, 2023 09:34
How to setup prettier as a pre-commit hook for Git commits.
commit.png
@codediodeio
codediodeio / index.js
Created June 28, 2017 15:54
Firebase Cloud Functions image thumbnail generator using Sharp for 4x faster resizing
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const sharp = require('sharp')
const _ = require('lodash');
const path = require('path');
const os = require('os');
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => {
const object = event.data; // The Storage object.
@pedronauck
pedronauck / controlAsyncFlow.js
Created September 7, 2014 05:58
Example using async library to avoid callback hell
var async = require('async');
var Product = require('../model/Product');
var Category = require('../model/Category');
var Attribute = require('../model/Attributes');
// bad idea
exports.index = function() {
Product.find(function(err, products) {
Category.find(function(err, categories) {
Attribute.find(function(err, attributes) {
config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/dash', {templateUrl: 'partials/dash.html', controller: 'DashCtrl', requireLogin: true});
$routeProvider.when('/user/list', {templateUrl: 'partials/user.list.html', controller: 'UserListCtrl', requireLogin: true});
$routeProvider.when('/user/new', {templateUrl: 'partials/user.form.html', controller: 'UserNewCtrl', requireLogin: true});
$routeProvider.when('/user/edit', {templateUrl: 'partials/user.form.html', controller: 'UserEditCtrl', requireLogin: true});
$routeProvider.when('/user/login', {templateUrl: 'partials/user.login.form.html', controller: 'UserLoginFormCtrl', requireLogin: false});
$routeProvider.otherwise({redirectTo: '/dash'});
}]).run(function ($rootScope, $location, Services, Enviroment) {
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active April 2, 2024 20:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version