Skip to content

Instantly share code, notes, and snippets.

View Keksike's full-sized avatar

Cihan Bebek Keksike

View GitHub Profile
// refaktoroitu versio
// muutoksia:
// * siirretty jakson valintojen hakulogiikka useRecommendations.ts -> Recommendations.tsx
// * siirretty jakson valintojen formatointilogiikka pois useEffect:istä suoraan komponentin rendaukseen (options={recommendations.map...)
//
// tällä mallilla koodia on vähemmän ja juttuja ei turhaan tehdä useEffecteissä tai muissa kansioissa "piilossa"
// voimme myös heittää tarpeettomaksi jääneet "Option"-importin ja useRecommendations.ts filut pois
import { CircularProgress, Divider } from "@material-ui/core";
import React, { useEffect, useState } from "react";
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
?>
<html>
<head>
<title>V2 tokenize credit card</title>
</head>
<body>
<h1>Request card form from v2 api</h1>
<hr />
/*
* Used to reduce boilerplate when creating simple redux-loop side-effects.
* runLoopFetch() can be directly provided with the success & fail action-types,
* which removes necessity to create actionCreator functions for each one.
*/
import { Cmd } from 'redux-loop'
type FetchFn = (...args: any[]) => Promise<any>
@Keksike
Keksike / mapAndFilter.js
Last active May 23, 2019 07:51
ramda map and filter mapandfilter
const mapAndFilter = (f) => R.compose(R.filter((x) => x !== undefined), R.map(f))
mapAndFilter((x) => x % 2 === 0 ? x+100 : undefined)([1, 2, 3, 4, 5])
> Array [ 102, 104 ]
@Keksike
Keksike / pull_request_template.md
Last active May 2, 2019 13:55
pull request template

Trello link

Please add a link here to the task/user story in Trello

Description

Please include a list of changes included in the PR here.

Notes

@Keksike
Keksike / foo.sh
Created April 12, 2019 07:18
serverless framework cloudfront url extract get
aws cloudformation describe-stacks --stack-name stackname-stagename | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "ServiceEndpoint") | .OutputValue'
@Keksike
Keksike / Ferritico_symbol_final_58x58.png
Last active November 14, 2018 14:55
Ferritico image
Ferritico_symbol_final_58x58.png
def tulosta(tahdit):
lista = ["vasen", "kaks", "kol", "nel", "viis", "kuus", "sei", "oikea"];
# apuri jota käytetään ton listan tulostamiseen
listaIterator = 0
for i in range(tahdit):
print(lista[listaIterator])
# jos listaIterator apuri kasvais yli listan pituuden, resetoidaan se
@Keksike
Keksike / koodiklinikka.md
Last active October 2, 2017 18:08
koodiklinikka esitys demopäivä

https://github.com/koodiklinikka/koodiklinikka.fi

  • Mikä Koodiklinikka?
    • Suomalainen ohjelmistokehittäjäyhteisö Slack:issä
    • tarkotuksena
      • koota ohjelmistokehittäjiä yhteen
      • ja toimia keskustelupaikkana
  • tärkeä periaaate: kuka tahansa saa liittyä
https://open.spotify.com/user/1110653944/playlist/0ZjRD2iAsKKbOlEpk3HUPj?si=weoPRO8O