Skip to content

Instantly share code, notes, and snippets.

Ian Macalinao macalinao

Block or report user

Report or block macalinao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a8712b527c6bc1a6ff525665b9e9f5c8
const fetch = require("node-fetch");
const main = async () => {
const result = await fetch(
"https://api-consumer-client.doordash.com/graphql",
{
credentials: "omit",
headers: {
accept: "*/*",
"accept-language": "en-US",
View gist:91ba8e2451f3560c14a7c05374740dfd
{ pkgs, lib, config, ... }:
lib.mkMerge [
(
pkgs.callPackage (import ./common.nix) { }
)
(
lib.mkIf
(builtins.pathExists "${config.home.homeDirectory}/private_secrets")
(
View useLoadMore.ts
import * as R from "ramda";
import { useState } from "react";
/**
* Default to displaying only pageSize items, but allow loadMore.
* @param items Items to return
* @param getId The serialized ID of the item.
* @param pageSize Number of items to display per page.
* @returns [filteredItems, loadMore, hasMore]
*/
View selfcontained.scala
[info] Compiling 1 Scala source to /Users/ian/proj/macalinao/scala-playground/target/scala-2.12/classes...
[error] /Users/ian/proj/macalinao/scala-playground/src/main/scala/pw/ian/playground/shapeless/BrokenSplitter.scala:87: ambiguous implicit values:
[error] both value scgen in object StatsAndPopGenerator of type => shapeless.Generic[pw.ian.playgroiund.shapeless.StatsAndPopGenerator.ScM]{type Repr = scala.collection.immutable.Map[Int,pw.ian.playgroiund.shapeless.StatsAndPopGenerator.Moments] :: shapeless.HNil}
[error] and value cgen in object StatsAndPopGenerator of type => shapeless.Generic[pw.ian.playgroiund.shapeless.StatsAndPopGenerator.ScS]{type Repr = Option[pw.ian.playgroiund.shapeless.StatsAndPopGenerator.Stat] :: shapeless.HNil}
[error] match expected type shapeless.Generic.Aux[MG,M]
[error] ] = genericGenerator
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 0 s, completed Nov 25, 2017 4:29:41 PM
View statsandpopgenerator.scala
[info] Compiling 1 Scala source to /Users/ian/proj/asunaio/alexandria/target/scala-2.12/classes...
[error] /Users/ian/proj/asunaio/alexandria/src/main/scala/asuna/alexandria/transforms/StatsAndPopGenerator.scala:73: ambiguous implicit values:
[error] both value scgen in object StatsAndPopGenerator of type => shapeless.Generic[asuna.proto.league.monoids.all_champions_sums.Scalars]{type Repr = scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna.proto.league.monoids.match_sum.Moments] :: scala.collection.immutable.Map[Int,asuna
@macalinao
macalinao / lol-champions.json
Created Sep 18, 2017
League of Legends Champions in JSON format
View lol-champions.json
{
"data": {
"static_entry": {
"champions": [
{
"value": {
"id": 69,
"name": "Cassiopeia",
"blurb": "Cassiopeia is a terrifying creature - half woman, half snake - whose slightest glance brings death. The youngest daughter of one of Noxus' most influential families, she was once a beautiful and cunning temptress capable of manipulating the hardest...",
"tags": [
View gist:c65fe0a726865ae986b2bdebe722454f
{
"data": {
"static_entry": {
"champions": [
{
"value": {
"id": 69,
"name": "Cassiopeia",
"image": {
"full": "Cassiopeia.png"
View NullTypeclass.scala
package pw.ian.playground.cats
import cats._
import cats.implicits._
// runMain "pw.ian.playground.shapeless.KittensNullMonoid"
object NullTypeclass {
case class Moments(ct: Int)
implicit val momentsMonoid: Monoid[Moments] = Monoid[Moments]
View KittensMonoidDerivation.scala
package pw.ian.playground.shapeless
import cats._
import cats.implicits._
import cats.data.NonEmptyList
import cats.derived._, monoid._, legacy._
// runMain "pw.ian.playground.shapeless.KittensMonoidDerivation"
object KittensMonoidDerivation {
View *scratch*.txt
{"@timestamp":"2017-05-20T05:09:19.357+00:00","@version":1,"message":"error processing batch BR/7.8 (size 80)","logger_name":"asuna.nova.ingestor.Ingestor","thread_name":"ingestor-75","level":"WARN","level_value":30000,"stack_trace":"java.lang.NullPointerException: null
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:43)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:41)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:43)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:41)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:43)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:41)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:43)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:41)
\tat cats.derived.MkSemigroup$$anon$2.combine(semigroup.scala:43)
You can’t perform that action at this time.