Skip to content

Instantly share code, notes, and snippets.

@jc1987
jc1987 / dock.sh
Created May 22, 2017 18:25
docker new server
docker run -e MYSQL_ROOT_PASSWORD=<root_password> -p <port_on_host>:3306 -d mysql/mysql-server
@jc1987
jc1987 / test.php
Created January 11, 2017 18:46
test.php for Agent
<?php
/**
* Mobile Detect Library
* =====================
*
* Motto: "Every business should have a mobile detection script to detect mobile readers"
*
* Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets).
* It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
@jc1987
jc1987 / blobimage.js
Created January 4, 2017 21:23
blobimage.js
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
function Vector(x, y) {
this.x = x;
this.y = y;
this.equal = function(v) {
@jc1987
jc1987 / blob.js
Created January 4, 2017 20:10
blob
function Vector(x, y)
{
this.x = x;
this.y = y;
this.equal = function(v)
@jc1987
jc1987 / random.js
Last active January 4, 2017 20:49
random
all into sun
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
setTimeout(function(){ jQuery.noConflict();jQuery('img').attr("src","//ssl.gstatic.com/onebox/weather/48/sunny.png"); }, 1000);
-----
@jc1987
jc1987 / precommit
Last active December 21, 2016 16:32
precommit cs
#!/usr/bin/env bash
echo "pre commit hook start phpcs"
CURRENT_DIRECTORY=`pwd`
GIT_HOOKS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIRECTORY="$GIT_HOOKS_DIR/../.."
cd $PROJECT_DIRECTORY;
PHP_CS_FIXER="php php-cs-fixer.phar"
@jc1987
jc1987 / DockerFile
Last active August 17, 2016 15:50
build your docker
FROM tutum/apache-php
RUN apt-get update && apt-get install -yq git && rm -rf /var/lib/apt/lists/*
RUN rm -fr /app
ADD . /app
RUN apt-get -yq update
RUN sudo apt-get install -yq software-properties-common
RUN sudo php -v
@jc1987
jc1987 / dock
Last active July 22, 2016 15:42
dock
docker network create --subnet=10.10.3.0/24 mynet
docker run --name wwmyew1 --ip 10.10.3.13 --net=mynet -e MYSQL_ROOT_PASSWORD=dooc -p 3306:3306 -d mysql/mysql-server
@jc1987
jc1987 / build.js
Created October 13, 2015 13:22 — forked from miloshadzic/build.js
({
baseUrl: 'app',
out: 'build/main.js',
optimize: 'uglify2',
name: 'libs/almond',
include: ['main'],
exclude: ['coffee-script'],
stubModules: ['cs', 'text'],
@jc1987
jc1987 / doctrine generate entity
Created July 14, 2015 15:04
doctrine generate entity
php app/console doctrine:generate:entities ZA/InvoiceBundle/Entity/Invoice --no-backup