Skip to content

Instantly share code, notes, and snippets.

View utensil's full-sized avatar

Utensil utensil

  • 22:19 (UTC +08:00)
View GitHub Profile
@Flast
Flast / client.cpp
Created December 8, 2012 12:36
Graceful Restart with Boost.Asio
#define BOOST_RESULT_OF_USE_DECLTYPE
#include <chrono>
#include <thread>
#include <boost/mpi.hpp>
#include <iostream>
#include <sstream>
#include <utility>
@dimitarcl
dimitarcl / Doxyfile
Created September 22, 2012 21:22
Documenting JavaScript with Doxygen
FILTER_PATTERNS =*.js=doxygen.js
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@luislavena
luislavena / gist:3251384
Created August 3, 2012 20:49
Testing Ruby 2.0 on Windows

Prepare for Ruby 2.0, today

Ruby 2.0 is around the corner, estimated to be launch February 2013, for its 20th anniversary!

Wouldn't be great to be able to test Ruby 2.0 features and report possible bugs?

Things like Refinements, built-in ANSI coloring for Windows or even better, faster startup

Users of other OS like Linux and OSX already can install upcoming versions of RUby thanks to RVM and rbenv tools, but what about Windows?

@paulmillr
paulmillr / active.md
Last active September 23, 2025 16:13
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@jbrisbin
jbrisbin / NioScalabilityTest.java
Created January 3, 2012 22:14
Pure Java NIO scalability test
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.StandardSocketOptions;
import java.nio.ByteBuffer;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
@jcsalomon
jcsalomon / Cyrillic.txt
Last active January 17, 2023 16:39
Useful Unicode characters & their code points 
(see http://www.unicode.org/Public/emoji/1.0/full-emoji-list.html for emoji)
0391 Α 03b1 α 0397 Η 03b7 η 039d Ν 03bd ν 03a4 Τ 03c4 τ 03dc Ϝ 03dd ϝ 03da Ϛ 03db ϛ
0392 Β 03b2 β 03d0 ϐ 0398 Θ 03b8 θ 03d1 ϑ 039e Ξ 03be ξ 03a5 Υ 03c5 υ 0370 Ͱ 0371 ͱ
0393 Γ 03b3 γ 0399 Ι 03b9 ι 039f Ο 03bf ο 03a6 Φ 03c6 φ 03d5 ϕ 03fa Ϻ 03fb ϻ
0394 Δ 03b4 δ 039a Κ 03ba κ 03f0 ϰ 03a0 Π 03c0 π 03d6 ϖ 03a7 Χ 03c7 χ 03de Ϟ 03df ϟ 03d8 Ϙ 03d9 ϙ
0395 Ε 03b5 ε 03f5 ϵ 039b Λ 03bb λ 03a1 Ρ 03c1 ρ 03a8 Ψ 03c8 ψ 0372 Ͳ 0373 ͳ 03e0 Ϡ 03e1 ϡ
0396 Ζ 03b6 ζ 039c Μ 03bc μ 03a3 Σ 03c3 σ 03c2 ς 03a9 Ω 03c9 ω
A 0410 А 0430 а Ye 0404 Є 0454 є Ka 041A К 043A к Te 0422 Т 0442 т Sha 0428 Ш 0448 ш
Be 0411 Б 0431 б Zhe 0416 Ж 0436 ж El 041B Л 043B л Tshe 040B Ћ 045B ћ Shta 0429 Щ 0449 щ
Ve 0412 В 0432 в Ze 0417 З 0437 з Lje 0409 Љ 0459 љ Kje 040C Ќ 045C ќ Yer 042A Ъ 044A ъ
@huacnlee
huacnlee / nginx.conf
Created September 14, 2011 13:50
Nginx http proxy cache to mirror of Rubygems.org
# 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度
# 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装
# 做这个起什么作用?
# rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。
# 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外
proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m
inactive=24h max_size=1g;
server {
listen 80;
@madhur
madhur / 0001-albino-windows-refactor.patch
Created September 1, 2011 07:34 — forked from jonforums/0001-albino-windows-refactor.patch
Make Jekyll play nice with Windows again post Albino + posix-spawn refactor
diff --git a/lib/albino.rb b/lib/albino.rb
index 387c8e9..b77d55e 100644
--- a/lib/albino.rb
+++ b/lib/albino.rb
@@ -1,4 +1,5 @@
require 'posix-spawn'
+require 'rbconfig'
##
# Wrapper for the Pygments command line tool, pygmentize.
@utensil
utensil / svn_graph.rb
Created August 25, 2011 05:14
ruby script to generate svn revision graph, focus on branching and tagging
#README
# In order to run this script, the following command line tools must be installed:
# 1) a subversion client, under Windows, Slik SVN is recommended: http://www.sliksvn.com/en/download
# 2) a Graphviz toolset, which can be downloaded from http://www.graphviz.org/
# Also the following ruby gems must be installed:
require 'rubygems'
#'xmlsimple'
# gem: http://rubyforge.org/frs/?group_id=638
# doc: http://xml-simple.rubyforge.org/