Skip to content

Instantly share code, notes, and snippets.

@xhh
xhh / errocodeNX.md
Created March 11, 2017 03:01 — forked from dietmarkuehl/errocodeNX.md
error_code article

Defining and Using a Symbol Analogue for Error Reporting in C++

Abstract

The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely

@ssteffl
ssteffl / recursive_copy.cpp
Created February 23, 2017 18:41
boost::filesystem recursive directory copy
using bfs = boost::filesystem;
void recursive_copy(const bfs::path &src, const bfs::path &dst)
{
if (bfs::exists(dst)){
throw std::runtime_error(dst.generic_string() + " exists");
}
if (bfs::is_directory(src)) {
bfs::create_directories(dst);
@remarkablemark
remarkablemark / README.md
Last active September 3, 2025 21:17
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@ryerh
ryerh / tmux-cheatsheet.markdown
Last active December 15, 2025 13:11 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@dietmarkuehl
dietmarkuehl / errocodeNX.md
Last active August 2, 2017 07:26 — forked from patrickmmartin/errocodeNX.md
error_code article

Defining and Using a Symbol Analogue for Error Reporting in C++

Abstract

The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely

@patrickmmartin
patrickmmartin / errocodeNX.md
Last active January 6, 2017 02:30
error_code article

Identify your Errors better with char[]

Abstract

The use of exceptions isn't a viable error handling approach in all cases and returning codes for error handling is sometimes preferable. However, using integral types for error identification is problematic as there is no good mechanism to guarantee that each value uniquely

@taylorSando
taylorSando / material-ui-reagent.clj
Created March 12, 2015 04:10
Material UI Reagent
;; material-ui.macros.clj
(ns material-ui.macros)
(def material-tags
'[AppBar
AppCanvas
Circle
Checkbox
DatePicker
DialogWindow
@city41
city41 / gist:aab464ae6c112acecfe1
Last active September 18, 2025 20:18
ClojureScript secretary client side navigation without hashes

This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.

I just got this working, so there might be better approaches

The changes are

  • use goog.history.Html5history instead of goog.History
  • listen to clicks on the page, extract the path from them, and push them onto the history
  • listen to history changes, and have secretary do its thing in response
@bingxie
bingxie / gist:a0039781a52ad908b0a2
Last active August 29, 2015 14:11
Nginx的配置
# nginx.conf
http {
client_max_body_size 20M; #上传文件的大小
}
------------------------------------------------------------------------------------
#Nginx应用配置
upstream app-name {
# 配置unicorn服务器器
server unix:/opt/app-name/tmp/sockets/unicorn.sock