Skip to content

Instantly share code, notes, and snippets.

View JasCodes's full-sized avatar
🎯
Focusing

Jaspreet Singh JasCodes

🎯
Focusing
View GitHub Profile
@JasCodes
JasCodes / quint_in_out_curve.js
Created September 24, 2022 09:18
Quint curve using simple equation
const f = (t) => (1 - (1 - (t * 2)) ** 5) / 2;
for (let t = 0; t <= 1.00001; t += 0.01) { console.log(`${t.toPrecision(2)}: ${f(t.toPrecision(6))}`); }
@JasCodes
JasCodes / json
Last active April 5, 2022 14:27
metadata
{
"name":"Love is Love Collection",
"image": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
"description": "Love is love hidden"
}
@JasCodes
JasCodes / pokemon.dart
Created September 19, 2020 17:17
GQLess
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class Pokemon extends StatelessWidget {
final pokemon = Pokemon();
@override
Widget build(context) {
return Scaffold(
appBar: AppBar(title: Text("Pokemon")),
@JasCodes
JasCodes / main.dart
Last active September 19, 2020 06:09
Dart Graphqless
// Pokemon Class is generated code from introspection
final NestedFragment = Pokemon(retFields:[id,name]);
final PokemonCard = Pokemon(returnFields:[maxHP,image],fragments:[NestedFragment]);
final q1Result = Pokemon(fragments:[PokemonCard]).query();
final q2Result = Pokemon(fragments:[PokemonCard],returnFields:[weight(returnFields:minimum,maximum),height(minimum,maximum)]).query();
@JasCodes
JasCodes / solution.js
Created July 1, 2020 20:17
Talenthut
/*
For random string s=‘zxzzzay’ and consecutive numbers as k=2 should return zzyzzxa.
Other example s=axxyyw & k=1 -> xyxywa
*/
function isMaxConsecutive(result, consecutiveNumbersAllowed, currentHashmapKey) {
let lastK = result.slice(-consecutiveNumbersAllowed)
if (lastK.length === consecutiveNumbersAllowed) {
return lastK.split("").every(v => v === currentHashmapKey)
}
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.index, this.title, this.icon, this.color);
final int index;
final String title;
final IconData icon;
final MaterialColor color;
}
### Keybase proof
I hereby claim:
* I am jascodes on github.
* I am jascodes (https://keybase.io/jascodes) on keybase.
* I have a public key ASBguVhTGECbG0FTXGk_UvUrwWz_PNDm_HOS2UIY4X5yiQo
To claim this, I am signing this object:
@JasCodes
JasCodes / graphql-typescript-typeorm.ts
Created April 1, 2018 14:34 — forked from kdby-io/graphql-typescript-typeorm.ts
An example for graphql-typescript with typeorm
import { Entity, Column, PrimaryGeneratedColumn, getRepository, CreateDateColumn, UpdateDateColumn } from 'typeorm'
import { Type, Field, ID, String, Mutation } from 'graphql-typescript'
class CreateUserArguments {
@Field(String) username: string
@Field(String) password: string
}
@Entity({ name: 'User' })
@Type