This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(CMAKE_BUILD_TYPE Debug) | |
cmake_minimum_required(VERSION 2.8.12) | |
project(libuv1) | |
add_definitions("-std=c++11") | |
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | |
conan_basic_setup() | |
add_executable(server server.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// thanks https://gist.github.com/thomseddon/3511330 | |
function formatBytes(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aback | |
abaft | |
abaxially | |
abeam | |
abed | |
abjectly | |
ably | |
abnormally | |
aboard | |
abominably |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#include <functional> | |
#include <iostream> | |
#include <string> | |
#include <utility> | |
#include <vector> | |
class MyBuf : public std::streambuf { | |
public: | |
MyBuf(int maxLength, std::function<void(const char *, int)> callbackFn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.railinc.spring.jdbc; | |
import java.io.PrintWriter; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.sql.DataSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# Convert the "svn log" output into a one liner format, which is easier to grep | |
# or use in scripts. Pipe "svn log" into this script | |
# When we get a line that starts with a revision number, put the data in variables | |
/^r[0-9]+/ { | |
rev=$1 | |
user=$3 | |
date=$5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.google.common.collect.Collections2.transform; | |
import java.util.Collection; | |
import java.util.HashSet; | |
import java.util.Set; | |
import com.google.common.base.Function; | |
import com.google.common.collect.Lists; | |
import com.google.common.collect.Sets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/osascript | |
set _count to 0 | |
if not (application "Mail" is running and application "Yojimbo" is running) then | |
return | |
end if | |
tell application "Mail" | |
repeat with _account in accounts | |
try | |
set _inbox to _account's mailbox "Inbox" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> [ (e.id, e.title) for e in Entry.objects.all() if e.status == Entry.STATUS_LIVE ] | |
[(5, u'Test Entry 2'), (3, u'Test Title 0')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bucket = "a-bucket"; | |
var filename = "logs/abc"; | |
var event = { | |
"Records": [ | |
{ | |
"s3": { | |
"object": { |
NewerOlder