Skip to content

Instantly share code, notes, and snippets.

View oguzcan-yavuz's full-sized avatar

Oguzcan Yavuz oguzcan-yavuz

View GitHub Profile

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:

@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
@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 / 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 / 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 / Dockerfile
Created June 5, 2018 16:07
kws Dockerfile
FROM nvidia/cuda:7.5-runtime-ubuntu14.04
LABEL maintainer "NVIDIA CORPORATION <[email protected]>"
RUN echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
ENV CUDNN_VERSION 4.0.8
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
RUN apt-get update && apt-get install -y --no-install-recommends \
libcudnn4=$CUDNN_VERSION && \
@oguzcan-yavuz
oguzcan-yavuz / server.js
Created June 3, 2018 13:27
simple cors example
const express = require('express');
const cors = require('cors');
let app = express();
const corsOptions = {
credentials: true,
origin: true,
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
exposedHeaders: ['x-auth-token']
};
@oguzcan-yavuz
oguzcan-yavuz / asker.rb
Last active May 14, 2018 16:52
ruby-final
=begin
antik cagda yasayan bir sultanin 1000 askeri vardir. askerler halka seklinde
siralaniyor. her asker sagindaki askeri kilicla yaraliyor ve yaralanan asker oyundan cikiyor.
oyun siradaki askere geciyor. yani halkanin ilk hali (1,2,3,4,5,6,7,8,9) iken sonraki hali
(1,3,5,7,9) oluyor.
yarismayi hangi asker kazanir? oyunu nesne tabanli programlama mantigi ile kodlayiniz.
NOT: kac asker oyuna dahil olacak ve oyunun kacinci askerden baslayacagini kullanici
belirleyecektir.
=end
@oguzcan-yavuz
oguzcan-yavuz / kamui.py
Last active December 1, 2017 19:43
surekli left click yaparak milleti birbirine dusuren program
#!/usr/bin/python3
import pyautogui
import time
coordinates = pyautogui.position()
while True:
pyautogui.click(coordinates)
time.sleep(0.01)