A Pen by Hakim El Hattab on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
#Simple MongoDB Security Tutorial
###1 - Start mongod without any "security option"
$ mongod --port 27017
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Orijinal https://github.com/shayne/wsl2-hacks | |
wsl2-hacks | |
Useful snippets / tools for using WSL2 as a development environment | |
--- | |
**Auto-start/services** (`systemd` support) | |
I've done a few methods that have had various levels of success. My goal was to make it feel seamless for my workflow and have commands work as expected. What's below is the current version of the setup I use. It allows me to use the MS Terminal as well as VSCode's Remote WSL plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Implements a texture atlas (https://en.wikipedia.org/wiki/Texture_atlas). | |
//! | |
//! The implementation is based on "A Thousand Ways to Pack the Bin - A | |
//! Practical Approach to Two-Dimensional Rectangle Bin Packing" by Jukka | |
//! Jylänki. This specific implementation is based heavily on | |
//! Nicolas P. Rougier's freetype-gl project as well as Jukka's C++ | |
//! implementation: https://github.com/juj/RectangleBinPack | |
//! | |
//! Limitations that are easy to fix, but I didn't need them: | |
//! |
OlderNewer