Skip to content

Instantly share code, notes, and snippets.

@shrekuu
shrekuu / form.html
Created May 11, 2017 10:27 — forked from siamak/form.html
Image Validator (Dimension) with javascript.
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Image Validator: </h3>
@shrekuu
shrekuu / fix-fouc.md
Last active May 12, 2017 02:55
Fix FoUC. Show the 'hidden' elements at next tick.

Put these code in your app.

<style>
.fix-fouc {
  opacity: 0;
  /* use this one if you need more compatibility */
  /* display: none;  */
}
</style>
@shrekuu
shrekuu / image-preview-modal-page.ts
Created May 27, 2017 02:49
Ionic image preview modal(NOT working), tried to add zooming
import {Component, ElementRef, ViewChild} from '@angular/core';
import {NavController, NavParams, ViewController} from 'ionic-angular';
@Component({
selector: 'page-image-preview-modal',
templateUrl: 'image-preview-modal.html',
})
export class ImagePreviewModalPage {
@ViewChild('myImg') myImg:ElementRef;
@shrekuu
shrekuu / .zshrc-for-mac-with-php5.6.sh
Last active June 15, 2017 02:51
.zshrc for macOS Sierra with system php5.6 and system apache2
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@shrekuu
shrekuu / default
Created September 19, 2017 05:51 — forked from dtomasi/default
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;
}
@shrekuu
shrekuu / ubuntu14-sever-configuration-procedure.md
Last active October 27, 2017 07:56
ubuntu-14-server-configuration-procedure 2017
@shrekuu
shrekuu / example.conf
Last active October 27, 2017 07:57
nginx server config example
server {
listen 80;
index index.php index.html index.htm;
root /var/www/example/public/;
server_name example.com;
location ^~ /api {
try_files $uri /index.php?$query_string;
}
@shrekuu
shrekuu / packager.js
Last active November 1, 2017 04:19
ancient js namespace
// Note: these code is tooooo old.
// version 1
function(t) {
function e(t) {
for (var e, i = ("" + t).split("."), r = window, o = 0; e = i[o]; o++) n.call(r, e) || (r[e] = {}), r = r[e];
return r
}
var n = Object.prototype.hasOwnProperty;
t.packager = function(t, n) {
@shrekuu
shrekuu / jenkins_ci_on_ubuntu.md
Created November 2, 2017 08:32 — forked from ostinelli/jenkins_ci_on_ubuntu.md
Setup Jenkins CI on Ubuntu.

Jenkins CI

Instructions on how to setup a secured Jenkins CI.

Install Jenkins

$ wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list$ .d/jenkins.list'
$ sudo apt-get update
$ sudo apt-get install jenkins
@shrekuu
shrekuu / nginx.conf
Created November 3, 2017 07:08 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;