Skip to content

Instantly share code, notes, and snippets.

View ozanmuyes's full-sized avatar

Ozan Müyesseroğlu ozanmuyes

View GitHub Profile
@ozanmuyes
ozanmuyes / openssl.MD
Created July 24, 2019 11:48 — forked from jchandra74/openssl.MD
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@htr3n
htr3n / macos-ramdisk.md
Last active May 7, 2024 02:13
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@falvarez
falvarez / docker-shell.sh
Created January 24, 2018 08:10
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash
// Create customFetch function for handling re-authorization
// This customFetch (or any fetch you pass to the link) gets uri and options as arguments. We'll use those when we actually execute a fetch.
const customFetch = (uri, options) => {
// In our application, the refresh token is stored in a redux store
// We create an instance of the state here so we can get the refresh token later in our request
let state = store.getState()
// This reference to the refreshingPromise will let us check later on if we are executing getting the refresh token.
this.refreshingPromise = null;
@diegovgsilva95
diegovgsilva95 / jsdoc.js
Created November 28, 2017 22:52
JSDoc for Timeout object (timers.setInterval / timers.setTimeout, prototype of "this" at callback context) #nodejs
/**
* @typedef {object} Timeout
* @prop {boolean} _called
* @prop {number} _idleTimeout
* @prop {object} _idlePrev
* @prop {object} _idleNext
* @prop {number} _idleStart
* @prop {function} _onTimeout
* @prop {any[]} _timerArgs
* @prop {number} _repeat
@culttm
culttm / axios.refresh_token.js
Created October 5, 2017 18:46
axios interceptors for refresh token
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
originalRequest._retry = true;
@kareniel
kareniel / neon-demo_echo.md
Last active March 11, 2024 15:25
echo a string in neon (rust & node)

echo a string in neon (rust & node

starting from the hello_world demo:

  1. we are gonna need the to_string method. but items from traits can only be used if the trait is in scope so we need to add Value to our use statement.

use neon::js::JsString;

@jchandra74
jchandra74 / openssl.MD
Last active February 16, 2024 21:23
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");