Skip to content

Instantly share code, notes, and snippets.

View guilhermehn's full-sized avatar

Guilherme Nagatomo guilhermehn

  • PagSeguro
  • Brasil, São Paulo
View GitHub Profile
@guilhermehn
guilhermehn / fn-classnames.js
Created June 9, 2019 23:32
classnames package in four lines with Ramda
import { when, is, map, filter, compose, nth, flatten, pipe, join } from 'ramda';
const isValueTruthy = compose(Boolean, nth(1));
const getTruthyKeys = compose(map(nth(0)), filter(isValueTruthy), Object.entries);
const classnames = (...args) => pipe(flatten, filter(Boolean), map(when(is(Object), getTruthyKeys)), flatten, join(' '))(args);
console.log(classnames('foo', 'bar', ['baz', ['deep', [[{ nested: true , falseNested: false }]]]], '', false, { foobar: true, no: false }));
@guilhermehn
guilhermehn / index.css
Created April 24, 2018 11:23
url-loader example
body {
/*
- image path should be relative
- taken from http://placehold.it/100x100
*/
background-image: url('./100x100.png');
}
@guilhermehn
guilhermehn / Remove all git tags
Created March 12, 2017 16:37 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@guilhermehn
guilhermehn / win32.go
Created June 23, 2016 20:27 — forked from nathan-osman/win32.go
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
var nodeExternals = require('webpack-node-externals')
module.exports = {
entry: './src/index.js',
target: 'web',
resolve: {
extensions: ['', '.js']
},
module.exports = {
// Your lib main file.
entry: './src/index.js',
// Where your lib will be used.
// Can be "web", "webworker", "node",
// "async-node", "node-webkit", "electron"
// If you use webpack everywhere you'll
// be fine with "node" most of the time
target: 'node',
import $ from 'jquery'
var MyLib = {
doSomething() {
// ...
}
}
export default MyLib
(function($) {
var MyLib = {
doSomething() {
// ...
}
}
// amd/umd mumbo jumbo
// simplified for the sake of brevity
if (typeof window !== 'undefined') {
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. Thanks.|
{It is|It's} {appropriate|perfect|the best} time to make some plans for the future and {it is|i
@guilhermehn
guilhermehn / Preferences.sublime-settings
Last active December 21, 2015 21:59
My Sublime Text 3 settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"drag_text": false,
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"font_size": 10,