Skip to content

Instantly share code, notes, and snippets.

View ijse's full-sized avatar
🎯
Focusing

Li Yi ijse

🎯
Focusing
View GitHub Profile
@warlock
warlock / config.yml
Last active January 16, 2024 10:44
fnproject docker-compose and remote deployment
# ~/.fn/config.yaml
cli-version: 0.5.96
current-context: default
api-url: http://192.168.0.69:8080
provider: default
registry: http://192.168.0.69:5000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@AmeliaBR
AmeliaBR / svg-tips-tricks-notes.md
Last active October 20, 2023 02:55
SVG Tips and Tricks (presentation at SVG Summit 2017)
@Zodiase
Zodiase / es6-abstract-class-example.js
Last active July 18, 2022 11:03
ES6 Abstract Class Example
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
@sbuzonas
sbuzonas / nginx-cors.conf
Created September 8, 2015 15:36
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
@sogko
sogko / app.js
Last active November 8, 2022 12:31
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@kaelzhang
kaelzhang / install.sh
Last active August 29, 2015 13:59
Compile and install couchdb 1.5.1 on Centos 6.4
#!/bin/bash
# Please run as root privilege
yum -y install libicu-devel curl-devel ncurses-devel libtool libxslt fop java-1.6.0-openjdk java-1.6.0-openjdk-devel unixODBC unixODBC-devel openssl-devel
# The rpm package on this site lacks of RSA V4 Signature, so we have to compile erlang from source code.
wget https://packages.erlang-solutions.com/erlang/esl-erlang-src/otp_src_R16B03-1.tar.gz
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 [email protected], salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/
@ijse
ijse / jsextend.js
Created May 25, 2012 03:02
JS:extend function based on Prototype
/**
* Function Extend based on Prototype
* @author ijse
*/
exports.extend = function(sub, superclass) {
var F = function() {};
F.prototype = superclass.prototype;
sub.prototype = new F();
sub.prototype.constructor = sub;
sub.superclass = superclass.prototype;