Skip to content

Instantly share code, notes, and snippets.

View a-m-dev's full-sized avatar

Ahmad Mirzaei a-m-dev

View GitHub Profile
// hi there
// this is a trick that blowed my mind
// => BY THIS =>
// you can use icon unicode (html unicode like ) that comes from api inside JS
// that is gonna be parsed and placed the icon it self instead of printing some jebrish in browser
// #01 . here is the function
const decodeHtml = (html) => {
var txt = document.createElement("textarea");
txt.innerHTML = html;
import { Spring, animated, config } from 'react-spring'
import { TimingAnimation, Easing } from 'react-spring/dist/addons'
const myComponent = () => {
return(
<Spring
@a-m-dev
a-m-dev / Nginx setup
Last active January 1, 2020 18:28
Simple Step by Step Nginx setup
# 01 - build your web app
# 02 - build the production version of your app into dist folder
# 03 - use express to create a simple server like below
const express = require('express')
const webpack = require('webpack')
const path = require('path')
const webpackMiddleware = require('webpack-dev-middleware')
01 - install hyper
02 - open config file by going to edit > Preferences
03 - comment all code
04 - add this setting:
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// MEDIA QUERIES
@mixin MIN_QUERY($min) {
@media screen and (min-width: $min){
@content;
}
}
@mixin MAX_QUERY($max) {
@media screen and (max-width: $max){
// react Part
import React from 'react'
class About extends React.Component {
constructor() {
super()
this.state = {
const t0 = performance.now()
...some operation
const t1 = performance.now()
console.warn(`request took: ${(t1 - t0) / 1000} s...` )
Command line instructions
Git global setup
git config --global user.name "a_m_dev"
git config --global user.email "a.mirzaei.dev@gmail.com"
Create a new repository
git clone http://tpi.uneed.ir:8888/root/webApp-main.git
cd webApp-main
touch README.md
// module one
class TempClass {
justLog() {
// do what ever the heck you want...
console.log('hi there...')
}
}
stages:
- develop
job_develop:
stage: develop
only:
- develop
tags: