Skip to content

Instantly share code, notes, and snippets.

View Gaubee's full-sized avatar
🫐
Growing

Gaubee Gaubee

🫐
Growing
View GitHub Profile

JAVA排队系统

数据表

用户:user

	u_id
	u_name
	u_email
	u_password
@Gaubee
Gaubee / 保存文件.js
Created January 12, 2014 14:14
HTML5文件操作API
var JSONResult = "hehehehehheheh??";
//保存文件
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
var URL = window.URL || window.webkitURL || window;
function saveAs(blob, filename) {
var type = blob.type;
var force_saveable_type = 'application/octet-stream';
if (type && type != force_saveable_type) { // 强制下载,而非在浏览器中打开
var slice = blob.slice || blob.webkitSlice || blob.mozSlice;
@Gaubee
Gaubee / 文字.json
Created January 12, 2014 07:00
这是数组类型的数据,一条条拆分开放在数据库里面,获取时返回数组。 类似的格式也可以
[{
// imgSrc: "../img/宋体.jpg",
title: "宋体",
layerAttr: {
type: "font",
width: 200,
height: 20,
src: "宋体"
}
},{
@Gaubee
Gaubee / PromiseCore.js
Last active March 1, 2018 03:00
将模块开发的实现的实现融合如Promise,衍生出更为简单的API,实现更为灵活自由、更加简单、更底层的一个回调处理工具。
(function(global) {
// if (typeof console === "undefined") {
// function noop() {};
// global.console = {};
// }
var uid = "__" + Math.random().toString(36).substr(2);
var uuid = function() {
uuid._uid = (~~uuid._uid) + 1;
return (uid + uuid._uid);
@Gaubee
Gaubee / Debian.md
Last active January 1, 2016 09:09
安装Debian的过程小计

在线安装的那个版本不给了,最后还是选择了Live版本的进行安装。安装结束后可能有启动不起来,在Boot里面切换不要用UFEI。

进去后最大的问题就是不能输入中文,所以先要安装输入法。

apt-get的安装方法虽然可行,但是要现有软件源。

gedit依赖问题没有随着系统过来,不知道是不是因为我的/home目录是之前用Ubuntu时带过来的一些东西导致的。

但是用nano还是很好用的。

@Gaubee
Gaubee / GetStackInfo.php
Created December 21, 2013 12:56
PHP调试输出调用堆栈
<?
function GetStackInfo(){
$e = new Exception();
$trace = $e->getTrace();
//position 0 would be the line that called this function so we ignore it
$last_call = $trace[1];
foreach ($trace as $stack_num => $call_stack) {
if ($stack_num) {
echo "<div style='padding-left:".(30*$stack_num)."px'><small>".$call_stack['file']."<small><b> ".$call_stack['line']."</b> <span style='color:#30e;'>".$call_stack['class']."->".$call_stack['function']."</span> </div><hr/>";
}
<?php
$services_json = json_decode(getenv("VCAP_SERVICES"),true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
$username = $mysql_config["username"];
$password = $mysql_config["password"];
$hostname = $mysql_config["hostname"];
$port = $mysql_config["port"];
$db = $mysql_config["name"];
$link = mysql_connect("$hostname:$port", $username, $password);
@Gaubee
Gaubee / php.md
Last active December 30, 2015 13:49
关于PHP开发环境安装

基础安装流程教程:Apache+php+mysql在windows下的安装与配置图解

到官方网站下载PHP安装包或者压缩包时,需要下载TS版本(线程安全),否则在配置Apache模块时会找不到 php5apache2_2.dll 这个模块文件,另外系统中需要有 Visual C++ 2008 SP1 ,一般电脑中都会有的,只是服务器上如果长期没更新可能就缺了这东西。

至于MySql的下载和安装,建议还是用MSI文件进行配置安装,Google mySQL installer就可以找到,ZIP程序包自然也可以,只是需要手动配置,得折腾时间,不过这些图形安装界面可能要依赖于.net Framework框架。一般服务器上是有的。

在安装ECSHOP时遇到了一些问题,上官看了一下,官方要求php版本最好是5.2(5~5.3),我上次下载安装的是5.3,官方网站已经把5.2以下的在下载页面中给刷下去了,找到相关的下载地址: 5.2.17 MSI文件 (推荐) 5.2.17 ZIP文件

@Gaubee
Gaubee / previewImage.js
Created December 5, 2013 09:38
JavaScript实现本地图片上传预览功能(兼容IE、chrome、FF) http://www.open-open.com/lib/view/open1340979512683.html
function previewImage(file) {
var porImg = $('#biuuu'), //首先获取大图片jquery对象
viewImg = $('#view'); //小图片jquery对象
//判断该浏览器是否为w3c标准,既非IE浏览器
if (file["files"] && file["files"][0]) {
//使用JavaScript的FileReader对象来读取本地数据,并且将数据结果赋值给image的src,具体该对象如何实现的还未深入研究
var reader = newFileReader();
reader.onload = function(evt) {
porImg.attr({
src: evt.target.result