Skip to content

Instantly share code, notes, and snippets.

View toanalien's full-sized avatar
🎯
Focusing

Thiên Toán toanalien

🎯
Focusing
View GitHub Profile
@toanalien
toanalien / .gitlab-ci.yml
Created June 2, 2017 15:48
.gitlab-ci.yml master
variables:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "123456"
REDISCLOUD_URL: "redis://redis:6379/"
stages:
- test
- deploy_static
- deploy
FROM python:2
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN wget https://deb.nodesource.com/setup_6.x
RUN bash setup_6.x
RUN apt-get install -y nodejs
RUN npm install phantomjs-prebuilt
build_image:
image: docker:git
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/cjs/cloudjet .
- docker push registry.gitlab.com/cjs/cloudjet:latest
only:
- build-image
function loadData(url, time=1) {
$.ajax({
url: url
}).done(function(res) {
return alert('done');
}).fail(function() {
if (time < 2) return loadData(time + 1, url);
return alert('fail');
})
}
#!/bin/bash
# Expects Ubuntu 16.06 (xenial) and kernel 4.x.
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191
set -eux
# Have the user call sudo early so the credentials is valid later on
sudo whoami
sudo apt-get install x11-xkb-utils -y
sudo apt-get install pkg-config -y
sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon -y
sudo apt-get install xrdp -y
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh
sudo systemctl restart xrdp
wget http://www.c-nergy.be/downloads/tigervncserver_1.6.80-4_amd64.zip
unzip tigervncserver*
sudo dpkg -i tigervncserver*.deb
@toanalien
toanalien / .gitlab-ci.yml
Created May 3, 2017 10:35
split gitlab-ci to multi phase
stages:
- test
- cleanup_test
- staging
- production
- cleanup
- compile_then_push
- restart_ci
before_script:
/*! FileSaver.js
* A saveAs() FileSaver implementation.
* 2014-01-24
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
* See LICENSE.md
*/
/*global self */
/* Blob.js
* A Blob implementation.
* 2014-05-27
*
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/eboyjr
* License: X11/MIT
* See LICENSE.md
*/
@toanalien
toanalien / exceljs.min.js
Created April 8, 2017 18:31
from exceljs/dist
/*! ExcelJS 07-04-2017 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.ExcelJS=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a,b,c){switch(void 0===c&&(c=!0),a.toLowerCase()){case"promise":if(!c&&e.Promish)return;e.Promish=b}}var e=a("../utils/promish");b.exports=d},{"../utils/promish":15}],2:[function(a,b,c){"use strict";var d="function