Skip to content

Instantly share code, notes, and snippets.

View yongzhihuang's full-sized avatar
🎯
Focusing

Yongzhi Huang yongzhihuang

🎯
Focusing
View GitHub Profile
@yongzhihuang
yongzhihuang / consolelog1.js
Last active November 25, 2015 17:28
Debug mode console log - credit to an kiddy script which I do not have the URL for
var debug = false;
var oldlog = console.log;
console.log1 = function() {
if (debug) {
oldlog.apply(this, Array.prototype.slice.call(arguments));
}
};
//usage
debug = true;
3/02/03
----------
Havn't write this diary for a long time, and time has changed everything. First of all, C++ is no longer my language, I managed to switch to Visual Basic because I finally realized that I want to become a professional database programmer or maybe an administrator. I've place an order of a VB book and it's coming soon. Somehow I got the urge of wanting to buy a laptop computer, I will start saving some money and maybe get a job. OT: I earned $75 yesterday night. Cousin returned from work(again).
10/16/02
----------
It's been a long time, a lot of things have happened. I bought 2 C++ books by accident, (Visual C++ and C++ in 21 days) Right now I'm gonna concentrate on MFC for VC++. I found out that it's very easy to make Windows programs with MFC, if I can handle it well, I might have to study it for a few years, maybe now I will want to become a professional windows developer. I don't know about game programming anymore, it seems too hard, you have to learn about math and other complicated
@yongzhihuang
yongzhihuang / gist:663c0d562e3717f4af05
Created July 7, 2015 14:49
Environment based script includes
{{#if GLOBAL.env.development}}
<script src="/path/to/development.js"></script>
{{else}}
<script src="/path/to/prodution.min.js"></script>
{{/if}}

Commit guideline

Try to use useful categorization for each commit, currently there are these categories:

  • [FEATURE] - A new feature or small additions.
  • [STYLE] - Style related commits.
  • [BUGFIX] - A fix for a bug, try to include links to project management ticket # for reference.
  • [DOCS] - Anything relates to documentation, including adding comments, updating readmes.
  • [CONFIG] - Configuration changes.
  • [CLEANUP] - Changes that do not affect functionality such as refactoring, restructuring.
@yongzhihuang
yongzhihuang / gist:4b2f54f827dda55f6fa6
Created December 29, 2014 15:52
Make slack play sound on new message
javascript:function playSound(b,a){b.mp3?b.mp3.paused?b.mp3.play():b.mp3.pause():(b.mp3=new Audio(a),b.mp3.play())}
setInterval(function(){if(localStorage.lastMessage)b=$(".message").last().find(".message_sender").text().trim(),a=$(".message").last().find(".message_content").text().trim(),a!==localStorage.lastMessage&&(c=/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/,a.match(c)&&a.match(c)[0]&&(a=a.replace(a.match(c)[0],b+" shared a link")),playSound(this,"https://mansueto.campfirenow.com/sounds/incoming.mp3"),localStorage.lastMessage=a);else{var b=$(".message").last().find(".message_sender").text().trim(),
a=$(".message").last().find(".message_content").text().trim(),c=/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/;a.match(c)&&a.match(c)[0]&&(a=a.replace(a.match(c)[0],b+" shared a link"));playSound(this,"https://mansueto.campfirenow.com/sounds/incoming.mp3");localStorage.lastMessage=a}},2500);
/** @jsx React.DOM */
var React = require('react');
var _ = require('lodash');
var Router = require('react-router');
var Link = Router.Link;
var Grapher = React.createClass({
getDefaultProps: function() {
return {