Skip to content

Instantly share code, notes, and snippets.

View bombless's full-sized avatar

York Xiang bombless

  • Guangzhou, China
View GitHub Profile
/*
* Taken from http://sower.com.au/2011/06/jquery-multilevel-accordion-in-10-lines-of-code/
*/
$(document).ready(function() {
$('.menu li ul').hide();
$('.menu li a').click(
function(evt) {
evt.preventDefault();
evt.stopPropagation();
var openMe = $(this).next();
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
Y组合子是Lambda演算的一部分,也是函数式编程的理论基础。
它是一种方法/技巧,在没有赋值语句的前提下定义递归的匿名函数。
即仅仅通过Lambda表达式这个最基本的“原子”实现循环/迭代。
颇有道生一、一生二、二生三、三生万物的感觉。
虽然Y组合子在理论上很优美,但在实际开发中并不会真的用到。
想要了解Y组合子是什么,请参见维基百科:http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator
或者知乎上的回答:http://www.zhihu.com/question/20115649
@bombless
bombless / birthday.cpp
Last active August 29, 2015 14:08 — forked from pezy/birthday.cpp
//
// main.cpp
// Test
//
// Created by pezy on 9/11/14.
// Copyright (c) 2014 PEZY. All rights reserved.
//
#include<iostream>
using namespace std;
% rustc goodbye.rs && rustc -L . beatles.rs && ./beatles
goodbye.rs:10:25: 10:29 warning: unused import, #[warn(unused_imports)] on by default
goodbye.rs:10 use syntax::ext::base::{self, ExtCtxt, MacResult, DummyResult, MacEager};
^~~~
I don't know why you say goodbye, I say hello
BracketMatcherView = require '/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js'
atom.workspaceView.eachEditorView (editorView) =>
if editorView.attached and editorView.getPane()?
new BracketMatcherView(editorView)
@bombless
bombless / README.md
Created August 30, 2018 09:51 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@bombless
bombless / PrintDirect.cs
Last active January 18, 2024 03:29 — forked from corytodd/csharp_gdi_print.cs
GDI Printing Example for C#
// https://www.c-sharpcorner.com/UploadFile/dbeniwal321/using-gdi-print-functionality/
//PrintDirect.cs
//shows how to write data directly to the
//printer using Win32 APIs.
//this code sends Hewlett-Packard PCL5 codes
//to the printer to print
//out a rectangle in the middle of the page.
using System;
using System.Text;
using System.Runtime.InteropServices;