Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Trying to quit vim

Volkan Çakıl volkancakil

:shipit:
Trying to quit vim
View GitHub Profile
@volkancakil
volkancakil / Enhance.js
Created Sep 2, 2016 — forked from sebmarkbage/Enhance.js
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@volkancakil
volkancakil / xrandr-full-screen.sh
Created Jan 18, 2017
xrandr full screen 1920x1080 resolution in VMWare with GNU/Linux
View xrandr-full-screen.sh
# Create 1920x1080 resolution mode
xrandr --newmode '1920x1080' 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
# Add new resolution mode to the display
xrandr --addmode Virtual1 1920x1080
# Resize the display to use the new resolution mode
xrandr --output Virtual1 --mode '1920x1080' --rate 60
@volkancakil
volkancakil / sec_tutorial.md
Created Jan 23, 2017 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial
View sec_tutorial.md

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@volkancakil
volkancakil / instGlobal.sh
Last active Feb 4, 2021
How to install GNU Global 6.5.6 on Ubuntu 16.10
View instGlobal.sh
#!/bin/bash
# instGlobal.sh
echo "instGlobal.sh ...."
echo "install package for GNU global..."
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install wget
sudo apt-get -y install ncurses-dev
View nvm-fix.zsh.sh
if [ -s "$HOME/.nvm/nvm.sh" ] && [ ! "$(type -f __init_nvm)" = function ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
declare -a __node_commands;__node_commands=(nvm `find -L $NVM_DIR/versions/*/*/bin -type f -exec basename {} \; | sort -u`)
function __init_nvm() {
for i in "${__node_commands[@]}"; do unalias $i; done
. "$NVM_DIR"/nvm.sh
unset __node_commands
unset -f __init_nvm
}
View dynamic-svg-image-placeholders.markdown

Dynamic SVG image placeholders

How it works

  1. Loads the Potrace Lib (6KB min+gzip)
  2. Starts loading the full res source image
  3. Meanwhile...
  4. Grabs a low res thumbnail from Cloudinary (~5KB)
  5. Uses Potrace to generate an svg from the thumbnail
  6. Colours and fades the SVG in as a crisp, full-size placeholder
@volkancakil
volkancakil / certificate.sh
Created Jul 29, 2018 — forked from WebReflection/certificate.sh
A basic Self Signed SSL Certificate utility
View certificate.sh
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
View ManageScroll.js
import React from "react";
import { Location } from "@reach/router";
let scrollPositions = {};
class ManageScrollImpl extends React.Component {
componentDidMount() {
let storage = sessionStorage.getItem("scrollPositions");
if (storage) {
scrollPositions = JSON.parse(storage);
View kaybase.md

Keybase proof

I hereby claim:

  • I am volkancakil on github.
  • I am volkancakil (https://keybase.io/volkancakil) on keybase.
  • I have a public key ASC8wBeKxqT4Ym_vgE2NWwIzijRwt9tWaf_znrA_0s55Dgo

To claim this, I am signing this object: