Skip to content

Instantly share code, notes, and snippets.

@zmofei
zmofei / gist:e5beff1877c92a5c6b9003b7fbf680cc
Last active April 22, 2016 09:09
最前端:2016年04月22日题目
题目比较简单,如何把一串数字转换成带分位的货币格式
e.g.
money(123124124) -> 123,124,124
money(123) -> 123
=====
@shamansir
shamansir / draw_svg.js
Last active February 20, 2023 16:11
draw SVG path on canvas
// take SVG commands and draw this path to HTML5 canvas
// commandList should look like that: [ { marker: "M", values: [ 10, 10 ] },
// { marker: "l", values: [ 5, 7 ] },
// { marker: "C", values: [ -5, 7.2, .3, -16, 24, 10 ] },
// . . .
// { marker: "z", values: [ ] } ]
// there's another gist which has the code to parse SVG paths:
// https://gist.github.com/shamansir/0ba30dc262d54d04cd7f79e03b281505
@oxUnd
oxUnd / install-php.md
Last active October 6, 2022 12:24
Mac下安装php-cgi

Mac下安装php-cgi

mac下安装php-cgi有多种方法,这里只介绍比较简单的两个方法;

  • 用brew安装
  • 直接下载安装XAMPP

用brew安装

如果安装了xcode,那么推荐使用brew来安装php。详细使用方法见官网,这里只说明如何装php-cgi;

@jimkang
jimkang / todos.js
Last active December 16, 2015 03:19
Possible way of dealing with Meteor collections' insert() not calling the callback when offline. This is code modified from the todos example (http://meteor.com/examples/todos).
Template.todos.events(okCancelEvents(
'#new-todo',
{
ok: function (text, evt) {
function doAfterInsert(error, _id) {
console.log("I was counting on this _id:", _id);
}
var connected = Meteor.status().connected;