Skip to content

Instantly share code, notes, and snippets.

// time and time end
console.time("This");
let total = 0;
for (let j = 0; j < 10000; j++) {
total += j
}
console.log("Result", total);
console.timeEnd("This");
// Memory
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt
echo.
echo -----
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
@ywwwtseng
ywwwtseng / host-react-app-on-apache-server.md
Last active May 3, 2024 15:52
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@thelebster
thelebster / ngrok-install.md
Created July 6, 2017 06:34
Expose localhost to the internet with Ngrok

Expose Localhost to the Internet With Ngrok

If you want a way to access your localhost easily on the public internet, lets say, to showcase the current work to a client, etc. This is where ngrok comes in. It allows us to establish a tunnel that forwards a port on our machine and make it available on the internet.

Ngrok is a Go program, distributed as a single executable file for all major desktop platforms. There are no additional frameworks to install or other dependencies.

This tutorial assumes you are using MAMP and have previously set up DNSMASQ.

@vielhuber
vielhuber / script.sh
Last active April 28, 2024 06:38
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@maxcnunes
maxcnunes / postgres-dblink.sql
Created April 11, 2016 11:36
Example using dblink to execute a SELECT query between different databases. (PG 9.4)
@tojibon
tojibon / Install.md
Last active February 11, 2024 01:52
Installing and Configuring ImageMagick on Xampp

#Steps to Install

  1. Download and Install ImageMagick http://imagemagick.org/script/binary-releases.php#windows
  2. Visit ImageMagic installation directory and module/coders copy all files and past on D:\xampp\apache\bin
  3. Download Binary https://pecl.php.net/package/imagick/3.4.0RC5/windows php 5.6 TS one according to phpinfo Architecture if it is x86/x64
  4. Exatract and copy php_imagick.dll to D:\xampp\php\ext
  5. Add php_imagick.dll on php.ini
  6. Copy 8 CORE_*.dll to D:\xampp\apache\bin
  7. Restart Apache
  8. done and visit phpinfo
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@gokulkrishh
gokulkrishh / media-query.css
Last active May 8, 2024 06:59
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */