This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
/* | |
- image path should be relative | |
- taken from http://placehold.it/100x100 | |
*/ | |
background-image: url('./100x100.png'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"syscall" | |
"unsafe" | |
) | |
var ( | |
kernel32 = syscall.NewLazyDLL("kernel32.dll") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodeExternals = require('webpack-node-externals') | |
module.exports = { | |
entry: './src/index.js', | |
target: 'web', | |
resolve: { | |
extensions: ['', '.js'] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from 'jquery' | |
var MyLib = { | |
doSomething() { | |
// ... | |
} | |
} | |
export default MyLib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var MyLib = { | |
doSomething() { | |
// ... | |
} | |
} | |
// amd/umd mumbo jumbo | |
// simplified for the sake of brevity | |
if (typeof window !== 'undefined') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
{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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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, |
NewerOlder