Skip to content

Instantly share code, notes, and snippets.

@foriacus
foriacus / test2.md
Last active August 14, 2018 08:06
test.md

Tournament

Tally the results of a small football competition.

Tally the results of a small football competition. Based on an input file containing which team played against which and what the outcome was create a file with a table like this:

Team                           | MP |  W |  D |  L |  P
@foriacus
foriacus / apps.md
Created November 22, 2015 01:27
A list of app names in my dock
  • Chrome
  • Chrome Canary
  • Firefox
  • Firefox Developer Edition
  • Opera
  • Opera Developer
  • Safari
  • (Webkit Nightly is currently missing)
  • Parallels Desktop with VMs for IE v9 through Edge.
  • Sublime Text 2
@foriacus
foriacus / mdb.md
Created October 7, 2015 02:02 — forked from tjfontaine/mdb.md

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

@foriacus
foriacus / react.md
Last active August 29, 2015 14:17
how to react.

1、ReactElement vs ReactComponent

ReactElement就是虚拟DOM,是React中的基本类型, 它是一个轻量的、无状态的、不可变的,对一个DOM Element的虚拟代表。它包含type,props,key和ref四个属性。它没有方法,在原型上也没有其它东西。

通过React.creatElement来创建ReactElement对象 var root = React.createElement('div);

创建了ReactElement对象之后,就可以通过React.render和一个常规的DOM元素(HTMLElement或者SVGElement)。 注意不要把ReactElment和DOM Element搞混。

@foriacus
foriacus / placeholder.js
Created March 3, 2015 08:07
This script will make placeholder text visiable in all browsers.
// This script will make placeholder text visiable in all browsers
// ---------------------------------------------------------------
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var loop = loop || {};
loop.shared = loop.shared || {};
loop.shared.actions = (function() {
"use strict";
// Actions are events that are triggered by the user, e.g. clicking a button,
// or by an async event, e.g. status received.
// They should be dispatched to stores via the dispatcher.
function Action(name, schema, values) {
@foriacus
foriacus / console-polyfill.js
Created January 28, 2015 02:01
console polyfill
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
@foriacus
foriacus / Makefile
Last active August 29, 2015 14:13 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@foriacus
foriacus / arale-tab.js
Created June 30, 2014 05:05
arale tab ui.
var SimpleTabView = Widget.extend({
attrs: {
triggers: {
value: '#pz-trip-ul span',
getter: function(val){
return this.$(val);
}
},
panels: {
value: '#pz-content > div',