Skip to content

Instantly share code, notes, and snippets.

View eric54205420's full-sized avatar

Eric9400 eric54205420

View GitHub Profile
@eric54205420
eric54205420 / gist:6b65b0de49a6ecda7d8b480e10f16b30
Created April 27, 2019 07:28 — forked from Kambfhase/gist:883016
A JavaScript Proxy for Fibonacci numbers.
// a fibonacci numbers object using proxy.
var fib = Object.create( Proxy.create({
getPropertyDescriptor: function( name){
var index = ~~name;
if( index == name && index > 1){
return {
get: function(){
var val = this[ index-1] + this[ index-2];
Object.defineProperty( this, index, {
value: val,
@eric54205420
eric54205420 / Code.gs
Created April 2, 2019 08:35 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Save PDF", functionName:"generatePdf"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu);
}
@eric54205420
eric54205420 / DoublyLinkedList.c
Created August 26, 2018 12:32 — forked from mycodeschool/DoublyLinkedList.c
Doubly Linked List implementation in C
/* Doubly Linked List implementation */
#include<stdio.h>
#include<stdlib.h>
struct Node {
int data;
struct Node* next;
struct Node* prev;
};
@eric54205420
eric54205420 / 20140901-mysql-admin-way-notes.txt
Created June 22, 2018 10:58 — forked from chenzx/20140901-mysql-admin-way-notes.txt
MySQL管理之道:性能调优、高可用与监控
MySQL管理之道:性能调优、高可用与监控
跳转至: 导航、 搜索
目录
1 MySQL 5.5介绍
2 半同步复制
3 故障诊断
4 同步复制报错故障处理
5 性能调优
6 备份与恢复
@eric54205420
eric54205420 / Makefile
Created April 9, 2018 12:56 — forked from mpenkov/Makefile
Quicksort in C
CFLAGS=-ggdb -Wall
all: quicksort.out
# $< the dependencies
# $@ the target
quicksort.out: quicksort.o
gcc -Wall -ggdb $< -o $@
clean: