Skip to content

Instantly share code, notes, and snippets.

View oguzcan-yavuz's full-sized avatar

Oguzcan Yavuz oguzcan-yavuz

View GitHub Profile
@oguzcan-yavuz
oguzcan-yavuz / download.js
Created August 7, 2018 11:12
node download example
// https://stackoverflow.com/questions/12740659/downloading-images-with-node-js
const fs = require('fs'),
request = require('request')
function download(uri, filename, callback){
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback)
}
download('https://www.google.com/images/srpr/logo3w.png', 'google.png', function(){
@oguzcan-yavuz
oguzcan-yavuz / rating-credit-scores-FLIP.js
Last active November 25, 2018 13:35
rating credit scores exercise
import { map, cond, gte, lte, flip, always } from 'ramda'
import scores from './scores.json'
const flippedGTE = flip(gte)
const flippedLTE = flip(lte)
const rater = cond([
[ flippedGTE(800), always(`excellent!`) ],
[ flippedGTE(700), always(`good`) ],
@oguzcan-yavuz
oguzcan-yavuz / main.go
Created November 29, 2018 00:10
My solution for the HDE Challenge 003
package main
import "fmt"
func square(x int) int {
return x * x
}
func calculateSum(numberCount int, sum int) int {
if numberCount == 0 {
@oguzcan-yavuz
oguzcan-yavuz / mongo-document-to-json.sh
Last active December 10, 2019 10:14
mongo document to json
# You need to copy the document to the clipboard before running this. The result will be copied to the clipboard.
pbpaste | perl -ne "s/(.*)( \w+\()(.*)(\))(.*)/\1\3\5/g; print;" | pbcopy

Keybase proof

I hereby claim:

  • I am oguzcan-yavuz on github.
  • I am oguzcan_yavuz (https://keybase.io/oguzcan_yavuz) on keybase.
  • I have a public key ASBSxnNkCgQMt6kZWhm-FHZjMDfym1N1Y5mqh-aq3UYLmgo

To claim this, I am signing this object: