Skip to content

Instantly share code, notes, and snippets.

View webix's full-sized avatar

Mika Lee webix

  • webix
  • Seoul, Korea
View GitHub Profile
@martinbean
martinbean / convert-seconds.js
Created July 13, 2016 08:03
Convert seconds to HH:MM:SS format in JavaScript.
new Date(seconds * 1000).toISOString().substr(11, 8)
@dtomasi
dtomasi / default
Last active December 8, 2023 04:20
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@amjadafanah
amjadafanah / Docker Java App (Nginx-Tomcat-MariaDB)
Last active July 30, 2016 12:18
Docker Java Names Directory application. This 3-Tier Docker Java Application is deployed on Docker Nginx, Tomcat Application Server and MariaDB. Once the application is deployed, get access to monitoring, alerts and notifications, continuous delivery using Jenkins, application backups, scale in/out, in-browser terminal to access the containers, …
LB:
image: nginx:latest
publish_all: true
mem_min: 50m
host: host1
plugins:
- !plugin
id: 0H1Nk
restart: true
lifecycle: on_create, post_scale_out:AppServer, post_scale_in:AppServer, post_start:AppServer, post_stop:AppServer
@devster31
devster31 / nginx.conf
Last active December 16, 2021 15:40
OS optimizations for ec2 t2.micro - WIP
# https://www.nginx.com/blog/tuning-nginx/
worker_connections 1024;
# Limit the number of connections NGINX allows, for example from a single client
# IP address. Setting them can help prevent individual clients from opening too
# many connections and consuming too many resources.
server {
# When several limit_conn directives are specified, any configured limit will apply.
limit_conn perip 10;
limit_conn perserver 100;
@webix
webix / _png.scss
Created January 13, 2015 07:43
remove PNG black border below IE8
%fix-png {
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); /* IE6 & 7 */
zoom:1;
&:hover {
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(enabled=false)";
filter:"progid:DXImageTransform.Microsoft.gradient(enabled=false)";
}
}
// SCSS
.rwdImage {
position: relative;
margin:0;
padding-bottom: 56.25%; /* 16:9 ratio */
height: 0;
overflow: hidden;
img {
position: absolute;
@webix
webix / _grid.scss
Last active August 29, 2015 14:13
This snippet is based on Hugo Giraudel's article(http://www.sitepoint.com/managing-responsive-breakpoints-sass/)
// susy default settings
@include border-box-sizing;
$susy: 16 ( 45px 30px ) static;
$layout-desktop: 16 ( 40px 20px ) static;
$layout-tablet : 12 ( 40px 20px ) static;
$layout-mobile : 2 ( 50% 15px ) fluid inside;
$layout-mobileport : 2 ( 50% 15px ) fluid inside;
$layouts: (
desktop: $layout-desktop,
@kerimdzhanov
kerimdzhanov / random.js
Last active April 20, 2024 03:21
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@gaerae
gaerae / MySQL table into CSV file 1.sql
Last active July 15, 2022 05:36
MySQL Table의 데이터를 CSV 형태로 내보내기 방법에는 여러가지가 있습니다.어떤 방법으로만 해야된다가 아닌 상황에 맞게 사용하는게 좋을 거 같습니다.4 가지 예시입니다.
SELECT * FROM my_table
INTO OUTFILE 'my_table.csv'
CHARACTER SET euckr
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'