Skip to content

Instantly share code, notes, and snippets.

View objectx's full-sized avatar

Masashi Fujita objectx

View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <assert.h>
static char digits [] = "0123456789" ;
static char separator = ',' ;
static void reverse (char *start, char *last) {
while (start < last) {
char tmp = *start ;

Keybase proof

I hereby claim:

  • I am objectx on github.
  • I am objectx (https://keybase.io/objectx) on keybase.
  • I have a public key whose fingerprint is 31BB BE25 3515 09F9 C73A 3ED0 5BF2 050C AC53 99F5

To claim this, I am signing this object:

@objectx
objectx / cxx-features.txt
Created October 10, 2015 15:32
List of C++ features (for CMake's target_compile_features)
cxx_aggregate_default_initializers # (C++14) Aggregate default initializers, as defined in N3605.
cxx_alias_templates # Template aliases, as defined in N2258.
cxx_alignas # Alignment control alignas, as defined in N2341.
cxx_alignof # Alignment control alignof, as defined in N2341.
cxx_attributes # Generic attributes, as defined in N2761.
cxx_attribute_deprecated # (C++14) [[deprecated]] attribute, as defined in N3760.
cxx_auto_type # Automatic type deduction, as defined in N1984.
cxx_binary_literals # (C++14) Binary literals, as defined in N3472.
cxx_constexpr # Constant expressions, as defined in N2235.
cxx_contextual_conversions # (C++14) Contextual conversions, as defined in N3323.
@objectx
objectx / powerShellStartScript.ps1
Last active August 29, 2015 14:17
[WIP] Start script for gradle's application plugin generated apps.
$FlagDebug = $true
$default_jvm_opts = ""
function debug {
if ($FlagDebug) {
Write-Host -foreground "yellow" $Args
}
}

Minimal Haskell Environment (on OSX Mavericks)

Prerequisite

  • Install Xcode 5.1 and enabling command line tools
  • Create GHC directory
    • I choose it as /opt/local/ghc-7.8.2 and chown’ed to me. [^1]

Install GHC

Download GHC binary package

$ curl http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-apple-darwin-mavericks.tar.xz -o ghc-7.8.2.tar.xz
{
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"font_face": "Source Code Pro ExtraLight",
"font_size": 16,
"ignored_packages":
[
"Vintage"
],
"tab_size": 8,
"theme": "Soda Dark 3.sublime-theme",
@objectx
objectx / Main.hs
Last active August 29, 2015 13:56
Invoke bash and send commands
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Monad (forM_)
import System.IO (hFlush, hGetContents, hPutStr)
import System.Process (createProcess, proc, StdStream(..), CreateProcess(..))
testScript :: [String]
testScript = [ "ls -lR"
* About to connect() to api.gvmtool.net port 80 (#0)
* Trying 54.243.121.176...
* Adding handle: conn: 0x7fda81806600
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fda81806600) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
@objectx
objectx / test-antbuilder.groovy
Last active December 19, 2015 01:19
AntBuilder test.
def ant = new AntBuilder ()
ant.echo ("Hello World.")
@objectx
objectx / indynize.ps1
Created June 14, 2013 13:21
InvokeDynamic enabler for Groovy on windows. Place it on <groovydir>/bin and run.
#
# indynize.ps1: InvokeDynamic enabler for Groovy on windows.
#
# AUTHOR(S): Masashi Fujita <[email protected]>
#
param ([switch]$WhatIf = $false, [switch]$Verbose = $false)
$groovydir = Split-Path -parent $MyInvocation.MyCommand.Path | Split-Path -parent