Skip to content

Instantly share code, notes, and snippets.

View hilkbahar's full-sized avatar

Hakkı hilkbahar

View GitHub Profile
@Sotatek-NuiTran
Sotatek-NuiTran / multi_ssh_git.md
Last active May 27, 2025 05:03
Setup SSH keys for multiple github and gitlab account

Setup SSH keys for multiple github and gitlab account

Prepare SSH keys:

Add a new key

$ ssh-keygen -t rsa_new -C "[email protected]"

Start ssh-agent

$ eval `ssh-agent -s`
@laphilosophia
laphilosophia / vuex-state-reset.js
Last active February 27, 2018 06:35
vuex state reset
export const RESET_STATES = 'resetStates'
function resetState (state, moduleState) {
const mState = state[moduleState]
if (mState.initState && typeof mState.initState === 'function') {
const initState = mState.initState()
for (const key in initState) {
mState[key] = initState[key]
@igogrek
igogrek / How I stopped loving Angular.md
Last active August 14, 2024 20:45
How I stopped loving Angular

I've worked with AngularJS for many years now and still use it in production today. Even though you can't call it ideal, given its historically-formed architecture, nobody would argue that it became quite a milestone not only for evolution of JS frameworks, but for the whole web.

It's 2017 and every new product/project has to choose a framework for development. For a long time I was sure that new Angular 2/4 (just Angular below) will become the main trend for enterprise development for years to come. I wasn't even thinking of working with something else.

Today I refuse to use it in my next project myself.

html {
height: 100%;
box-sizing: border-box;
}
body {
position: relative;
padding-bottom: 6rem;
min-height: 100%;
}
@hilkbahar
hilkbahar / nestedToFlatArray.js
Last active September 19, 2016 11:40
Nested Integer Array to Flat Integer Array
function nestedToFlatArray(arr, returnArr) {
if(returnArr.length == 0)
returnArr = [];
for(var i=0; i<arr.length; i++) {
if(Array.isArray(arr[i])) {
nestedToFlatArray(arr[i], returnArr);
}
else {
returnArr.push(arr[i]);

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@callmephilip
callmephilip / gist:3519403
Created August 29, 2012 21:52
[JavaScript] Dispatching keyboard event
// gecko and webkit
// details here https://developer.mozilla.org/en-US/docs/DOM/event.initKeyEvent
var keyboardEvent = document.createEvent("KeyboardEvent");
var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
keyboardEvent[initMethod](
"keydown", // event type : keydown, keyup, keypress
true, // bubbles