Skip to content

Instantly share code, notes, and snippets.

View v0lkan's full-sized avatar
🎸
totally rocking it 🚀.

Volkan Özçelik v0lkan

🎸
totally rocking it 🚀.
View GitHub Profile
@v0lkan
v0lkan / switching-reducer.js
Last active March 2, 2018 05:03
Switching Reducer
// I find myself using this utility function frequently.
// I don’t know if this pattern has a name, yet I’d like
// to call it the “switching reducer”.
// Here’s how you define it:
// ########################
// The Library
// ########################
@v0lkan
v0lkan / evolution-of-a-fetch.js
Last active February 26, 2018 08:27
The Evolution of a Fetch
// Assume `dispatch` and `fetchFromNetwork` are defined elsewhere.
// ## 1. CPS With Nodebacks
// This is the old-school-style fetch. Mostly here for
// historical reasons.
//
// Yet, contrary to the arguments against using it,
// it‘s not that hard to maintain this code when you are
// careful and know what you are doing.
@v0lkan
v0lkan / evolution-of-a-fetch.js
Created February 23, 2018 22:44
The evolution of a moderately-complicated fetch request
// Assume `fetch` and `notify` are defined elsewhere.
// ## 1. CPS With Nodebacks
function fetchAppState() {
return function(dispatch) {
fetch(function(err, data) {
if (err) {
console.error('Poop', err);
return;
@v0lkan
v0lkan / leylim.md
Last active July 22, 2017 20:11
Leylim Code Review
export default class Area extends Bus

Bus’i extend etmek yerine; bus statik bir nesne olsa ve icerde dogrudan bus’u kullansan daha iyi. Yani

// bunun yerine
this.subscribe(this.handleEvents);
@v0lkan
v0lkan / docker-i-t-trivia.md
Last active July 25, 2023 04:35
docker run -i -t
docker run -i -t --name nodejs ubuntu:latest /bin/bash

So here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.

Some more trivia about these flags.

@v0lkan
v0lkan / teachers-needed.md
Created March 29, 2017 20:37 — forked from 1Marc/workshops-planning.md
Workshop Teachers Needed

Looking for workshop teachers to teach on the following topics!

For introductions please tweet @frontendmasters, @1marc or email: marc at FrontendMasters.com. Thanks!

You can propose other topics too.

Published blog post detailing topics and allowed people to vote on priority: 2016 Frontend Masters topic poll

Bolded topics are very highly requested.

@v0lkan
v0lkan / invalidate.js
Created March 13, 2017 16:38
Invalidates ServiceWorkers so that you can fetch your assets freshly.
/**
* Invalidates the current `ServiceWorker` running on the page.
* Why? Because managing a cache is damn hard; and sometimes due to race conditions
* your assets might get out-of-sync.
*
* This mini snippet checks the version of the app against an uncached resource and
* invalidates the workers if it finds a mismatch.
*/
if ( navigator.serviceWorker && navigator.serviceWorker.getRegistrations ) {
@v0lkan
v0lkan / silence.sh
Last active August 19, 2025 22:50
How to Have a Silent and High-Performing Western Digital MyCloud Mirror
#
# Needless to say, I (Volkan Ozcelik) take no responsibility, whatsoever,
# about what will happen to your NAS when you try these.
# When did it to mine, I observed *ENORMOUS* performance gain and a zen-like silence.
#
# +----------------------------------------------------------+
# | WHAT YOU ARE GOING TO DO CAN LIKELY VOID YOUR WARRANTY |
# | SO PROCEED WITH CAUTION |
# +----------------------------------------------------------+
#
@v0lkan
v0lkan / ado.vbs
Created December 23, 2016 03:41
ado.vbs
<%
' Microsoft ADO
'
' (c) 1996 Microsoft Corporation. All Rights Reserved.
'
' ADO constants include file for VBScript
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
@v0lkan
v0lkan / foo.hs
Created December 21, 2016 23:42
foo.hs
λ help
λ 5 + 12
17
:: Num a => a
λ "volkan"
"volkan"
:: [Char]
λ [1,2,3,4]
[1,2,3,4]
:: Num t => [t]