Skip to content

Instantly share code, notes, and snippets.

@aristotll
aristotll / NettyGroupBenchmark.java
Created October 30, 2022 05:21 — forked from kofemann/NettyGroupBenchmark.java
Netty Event loop benchmark
package dev.kofemann.playground;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.epoll.EpollEventLoopGroup;
@aristotll
aristotll / App.java
Created March 24, 2018 14:58 — forked from kishida/App.java
かわいいデータベース
package kis.basicdb;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@aristotll
aristotll / genesis_public_key
Created February 8, 2018 14:41
genesis_public_key
04b349859353359e2a02d85b245691ce9de9e12294080a6a887482251232eb99cd8ff51fc144a05e1bb4c4691d7141a516cb7e9b5a726e9b0d232e01c2cff7a568
@aristotll
aristotll / Customer.java
Created December 18, 2017 13:42 — forked from gulench/Customer.java
POJO with Lombok
@Data
public class Customer {
private String name;
private String surname;
private String nickname;
}
@aristotll
aristotll / haproxy.conf
Created March 21, 2017 02:57 — forked from nateware/haproxy.conf
HAProxy sample config for EC2
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
@aristotll
aristotll / einbeinige.rb
Created March 19, 2017 13:51 — forked from mkempe/einbeinige.rb
Using ActiveRecord / Nokogiri for xml → database convert action
# encoding: utf-8
require 'active_record'
require 'mysql2'
require 'nokogiri'
require 'yaml'
ROOT = File.join(File.dirname(__FILE__), '..')
# ActiveRecord::Base.logger = Logger.new('log/debug.log')
@aristotll
aristotll / get-fonts.sh
Created February 16, 2017 03:20 — forked from mccxj/get-fonts.sh
自动安装微软雅黑
wget -O get-fonts.sh.zip http://files.cnblogs.com/DengYangjun/get-fonts.sh.zip
unzip -o get-fonts.sh.zip 1>/dev/null
chmod a+x get-fonts.sh
./get-fonts.sh
@aristotll
aristotll / everythingmenu.ahk
Created January 12, 2017 14:47 — forked from 10sr/everythingmenu.ahk
everything search engine用ahkスクリプト
/*
iniにこんな感じで入れる
open_file_command=$exec("C:\My Dropbox\apps\AutoHotkey\AutoHotkey.exe" "C:\My Dropbox\apps\Everything\everythingmenu.ahk" "%1")
open_folder_command=$exec("C:\My Dropbox\apps\AutoHotkey\AutoHotkey.exe" "C:\My Dropbox\apps\Everything\everythingmenu.ahk" "%1")
*/
#NoTrayIcon
CoordMode,menu,relative
SplitPath, A_LineFile, emenu_scriptname, emenu_scriptdir,
targetpath = %1%
FileGetAttrib, fileatt , %targetpath%

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@aristotll
aristotll / schemacrawler.bat
Created October 29, 2016 07:00 — forked from djangofan/schemacrawler.bat
Example of using schemacrawler from the command line with Oracle
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
SET TITLE=Schema crawler
TITLE %TITLE%
ECHO.&ECHO.
:: FORMAT can be csv or html
SET FORMAT=html
SET INPUTFILE=table.names
SET USER=user