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
# The name of our project is "HELLO". CMakeLists files in this project can | |
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and | |
# to the root binary directory of the project as ${HELLO_BINARY_DIR}. | |
cmake_minimum_required (VERSION 2.8) | |
project (HELLO) | |
# Recurse into the "Hello" and "Demo" subdirectories. This does not actually | |
# cause another cmake executable to run. The same process will walk through | |
# the project's entire directory structure. | |
add_subdirectory (Hello) |
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 <iostream> | |
#include <functional> | |
using namespace std; | |
std::function<int()> getProc() { | |
static int a = 0; | |
auto p1 = [&]() { | |
a++; |
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
# Select 'mega' for the 1280 APM1, 'mega2560' otherwise | |
BOARD = V2R | |
# BOARD = LINUX | |
# HAL_BOARD determines default HAL target. | |
HAL_BOARD ?= HAL_BOARD_V2R | |
# HAL_BOARD ?= HAL_BOARD_LINUX | |
# The communication port used to communicate with the APM. | |
PORT = /dev/ttyACM0 |
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
#!/bin/sh -x | |
# 1. Add to ~/.bashrc[[ -f ".goenv" ]] && source .goenv | |
# 2. Put symbol link to this file named .goenv in some folder | |
# 3. start bash in this folder | |
# Path where GO is installed | |
GO_INSTALL_PATH=/opt/go | |
HERE=$(pwd) |
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 java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.text.ParsePosition; | |
public class DateTimeTest { | |
public static void main(String[] args) { | |
// Create parser | |
SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd"); | |
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 java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.text.ParsePosition; | |
public class DateTimeTest { | |
public static void main(String[] args) { | |
// Create parser | |
SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd"); | |
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
#!/bin/sh | |
set -e | |
stun -v $1 2>&1 | grep MappedAddress | head -1 | wc -l |
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
#!/bin/sh | |
set -e | |
# This GIT hook helper checks staged changes for 'DO NOT COMMIT' string | |
# Returns non-zero if found | |
# To install this check into .git/hooks/pre-commit | |
# just add line '/path/to/check-do-not-commit.sh || exit 1' >>BEFOR<< last line with 'exec git diff-index ...' | |
# The bottom of .git/hooks/pre-commit should looks something like this: |
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
// playground http://jsfiddle.net/1ssfjxu1/1/ | |
$.fn.htmldump = function() { | |
function walk(element, callback) { | |
if (callback) { | |
callback.apply(element); | |
} | |
$(element).children('*:not(script)') | |
.each(function(i, child) {walk(child, callback)}); |
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 saveData = (function () { | |
var a = document.createElement("a"); | |
document.body.appendChild(a); | |
a.style = "display: none"; | |
return function (data, fileName) { | |
var json = JSON.stringify(data), | |
blob = new Blob([json], {type: "octet/stream"}), | |
url = window.URL.createObjectURL(blob); | |
a.href = url; | |
a.download = fileName; |
OlderNewer