Skip to content

Instantly share code, notes, and snippets.

View byurhannurula's full-sized avatar
🏠
Working from home

Byurhan Nurula byurhannurula

🏠
Working from home
View GitHub Profile
@byurhannurula
byurhannurula / ubuntu_nginx_node_ssl.md
Last active May 30, 2020 15:34
Setup Nginx server with Node.js on Ubuntu Server

Node.js Deployment

Steps to deploy a Node.js app to Ubuntu Server VM using PM2, NGINX and an SSL from LetsEncrypt

1. Create VM

2. Install Curl

@byurhannurula
byurhannurula / gist:8cccce3da9ae527358ea76f507b8e505
Created May 1, 2020 12:33 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
// This attribute exists on the element
[value]
// This attribute has a specific value of 'hello'
[value='hello']
// This attribute value contains the word 'hello' somewhere in it
[value*='hello']
// This attribute value contains the word 'hello' in a space-separated list
@byurhannurula
byurhannurula / media.js
Last active November 13, 2019 12:14
CSS in JS media query helper.
import { css } from 'styled-components'
// Breakpoints
const breakpoints = {
mobileMin: '480px',
mobileMax: '959px',
tabletMin: '960px',
tabletMax: '1199px',
desktopMin: '1200px',
@byurhannurula
byurhannurula / animatedScrollTo.js
Created November 12, 2019 16:07 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@byurhannurula
byurhannurula / Repeat.js
Created October 15, 2019 14:58 — forked from mskoroglu/Repeat.js
react repeat component
/**
* usage:
* <ul>
* <Repeat times="3">
* <li>item</li>
* </Repeat>
* </ul>
* or
* <ul>
* <Repeat
# name: simply
# Colors
set cyan (set_color cyan)
set yellow (set_color yellow)
set red (set_color red)
set blue (set_color blue)
set green (set_color green)
set orange (set_color ff8300)
set gray (set_color 666666)
@byurhannurula
byurhannurula / keybindingsMac.json
Last active July 18, 2019 12:41
VS Code Settings Gist
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+a",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "ctrl+shift+s",
"command": "workbench.action.toggleStatusbarVisibility"
}
@byurhannurula
byurhannurula / image.jsx
Last active July 15, 2019 17:27
Gatsby Image component
import React from 'react'
import Img from 'gatsby-image'
import { graphql, useStaticQuery } from 'gatsby'
const query = graphql`
query {
images: allFile(filter: { extension: { regex: "/jpeg|jpg|png|gif/" } }) {
edges {
node {
extension
/* eslint-disable react/display-name */
/* eslin-disable */
import React, { useState } from 'react'
import { Mutation } from 'react-apollo'
import { adopt } from 'react-adopt'
import {
Container,
Row,
Col,
Card,