Skip to content

Instantly share code, notes, and snippets.

View kutyel's full-sized avatar
🌊
数学者に俺は成る!

Flavio Corpa kutyel

🌊
数学者に俺は成る!
View GitHub Profile
module GoogleChart exposing (..)
import Html exposing (Html)
import Html.Attributes as HtmlA
import Json.Encode as E
import List.Extra as List
import Chart exposing (..)
colors =
@kutyel
kutyel / .babelrc
Created August 7, 2019 10:23
Personal JS options 😉🚀
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions",
"ie >= 11"
@rachelcarmena
rachelcarmena / curry.js
Created August 5, 2019 16:02
A possible curry function in JS
const curry = fn => {
const arity = fn.length;
const _curry = (...args) =>
args.length === arity
? fn(...args)
: arg => _curry(...args, arg);
return _curry();
}
@kutyel
kutyel / loc.sh
Last active May 9, 2019 10:22
Count lines of JS code in a repo
git ls-files | grep \\.js$ | xargs wc -l
@choonkeat
choonkeat / Http.Extra.elm
Last active July 7, 2021 13:16
Http.task { resolver = Http.stringResolver decoder, ... }
module Http.Extra exposing (..)
import Http
import Json.Decode
{-| to obtain a String from `Http.task`
Http.task
{ resolver = Http.stringResolver httpStringBodyResolver
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@IagoLast
IagoLast / .block.yml
Last active November 8, 2023 13:16
Webmercator, geojson and 2D canvas
license: gpl-3.0
height: 600
scrolling: no
border: no
@kutyel
kutyel / unfollow.fp.js
Created December 19, 2017 13:48
Twitter Unfollow Bot
'use strict'
require('now-env')
const Twit = require('twit')
const Task = require('data.task')
const Maybe = require('data.maybe')
const bot = new Twit({
consumer_key: process.env.CONSUMER_KEY,
consumer_secret: process.env.CONSUMER_SECRET,
access_token: process.env.ACCESS_TOKEN,
@kutyel
kutyel / curry.js
Last active August 5, 2019 20:51
My own implementation of curry 🍛
// Ultimate version
const curry = (f, ...args) =>
f.length <= args.length
? f(...args)
: x => curry(f, ...args, x)