Skip to content

Instantly share code, notes, and snippets.

View mygoare's full-sized avatar
:octocat:

Gore mygoare

:octocat:
View GitHub Profile
@mygoare
mygoare / README.md
Created April 11, 2014 08:28 — forked from mbostock/.block
Learn to Custom d3 brush handle style

This example demonstrates how to add visible and draggable handles to D3’s d3.svg.brush component, rather than that relying on the invisible boundary of the brush extent. The handle sizes here are exaggerated for demonstration purposes!

@mygoare
mygoare / cleanUp.sh
Last active August 29, 2015 13:58
Fix duplicate/old items on "Open with" list
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
@mygoare
mygoare / index.html
Last active July 13, 2018 14:09
d3 add images
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<p>d3 add images</p>
<script src="jsbin.xeruz.js"></script>
@mygoare
mygoare / colored_bash.md
Last active January 3, 2016 02:29
color bash

##用于在shell中给输出上色 ( Colored Bash )

###基本结构:

\033[A;B;Cm YOUR CONTENT \033[m

###A B C是字母替代

A => Attribute codes

@mygoare
mygoare / sizzle_usage.js
Created August 27, 2013 07:12
sizzle.js
var lcq={};//全局变量
(function($){
$.get=Sizzle;
$.bind=function(element,event,fn){if(element){if(element.addEventListener){console.info("addEventListener"); element.addEventListener(event,fn,false);}else{console.info("attachEvent"); element.attachEvent("on"+event,fn);}}
}
})(lcq); //自执行函数表达式
function _test(){ alert(lcq.get("#dv1")[0].innerHTML); }
//窗口加载事件
window.onload=function(){
lcq.bind(lcq.get("#btnTester")[0],"click",_test);/*给按钮绑定事件*/
@mygoare
mygoare / ?.js
Last active December 20, 2015 19:28
nice三位判断
var audio = new Audio();
audio.src = Modernizr.audio.ogg ? 'background.ogg' :
Modernizr.audio.mp3 ? 'background.mp3' :
'background.m4a';
audio.play();
@mygoare
mygoare / gist:1885678
Created February 22, 2012 15:57
整合了前面的PHP数据库连接类~~做成一个分页类!
不知道学PHP有没有前途~哎越写越没劲
<?php
Class createdb //类的开始
{
var $db= "localhost";//数据库地址;
var $dbname = "root";//用户名;
var $dbpwd = "";//密码;
var $dbtable = "mysql";//使用的数据库
var $conn; //数据库连接;
var $result; //结果集
@mygoare
mygoare / gist:1788523
Created February 10, 2012 10:18
ajax
ajax原理
ajax对象
open()打开 open(method,url,true) the url -- a file on a server.
onreadystatechange
send()
GET方法在open()时即可发送信息体
e.g.
@mygoare
mygoare / gist:1777994
Created February 9, 2012 07:02
php throw err try catch获取异常
<?php
function de($a)
{
if($a==0)
{
throw new Exception("can't be zero!");
}
}
try
@mygoare
mygoare / gist:1771401
Created February 8, 2012 17:21
回学校自己手写的一些代码
回校第一天晚上:
表单验证
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>form</title>
</head>