Skip to content

Instantly share code, notes, and snippets.

View objectx's full-sized avatar

Masashi Fujita objectx

View GitHub Profile
@objectx
objectx / test.c
Created March 27, 2012 00:51
An annoying way to copy a region. Don't try this anymore.
#include <sys/types.h>
void copy (char *dst, char *src, size_t size) {
if (size == 0) {
return ;
}
size_t sz = size / 4 ;
switch (size % 4) {
while (sz-- != 0) {
default:
@objectx
objectx / color-schemes.ini
Created August 29, 2012 03:37
My current SlickEdit color scheme.
[objectx]
# Scheme version
VERSION=21
# Associated symbol coloring
ASSOCIATED_SYMBOL_SCHEME=object_symbols
#
# suffixes:
# fg: Foreground Color
# bg: Background Color
# ff: Font Flags
@objectx
objectx / The NINJA WARRIORS Ed.txt
Created September 13, 2012 12:20
The NINJA WARRIORS arcade opening/ending demo message.
A revolution broke out. And everything became to an end. The troubled country seemed to be finished by the death of the wicked machines. But the peace did not come. Because The NINJA WARRIORS, they are the immortal murder machines.
blob
mark :1
data 0
reset refs/heads/master
commit refs/heads/master
mark :2
author Masashi Fujita <objectxtreme@gmail.com> 1351756400 +0900
committer Masashi Fujita <objectxtreme@gmail.com> 1351756400 +0900
data 16
@objectx
objectx / gist:4131424
Created November 22, 2012 14:26
Run "vv serv" in background.
$mydir = Split-Path -parent $MyInvocation.MyCommand.Path
$work_dir = [Environment]::GetFolderPath("MyDocuments")
function start_process () {
$veracity = Join-Path $(Get-Item HKLM:\Software\Sourcegear\Veracity).GetValue("InstallPath") "vv.exe"
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
$processStartInfo.FileName = $veracity
$processStartInfo.WorkingDirectory = $work_dir
@objectx
objectx / gist:4153243
Last active October 13, 2015 06:27
Visual C++ properties.

Output Directory (for executables).

$(SolutionDir)build\bin-$(PlatformName)\

Output Directory (for libraries).

$(SolutionDir)build\lib-$(PlatformName)\

Intermediate Directory

$(SolutionDir)build\tmp$(ProjectName)-$(PlatformName)-$(Configuration)\

@objectx
objectx / paths.cpp
Last active December 10, 2015 18:18
Path handling utilities.
/*
* paths.cpp:
*
* Author(s): objectx
*/
#include "common.h"
#include "../paths.h"
std::string GetBaseName (const std::string &s) {
auto pos = s.find_last_of ('\\') ;
@objectx
objectx / vagrant.ps1
Last active December 15, 2015 12:19
vagrant starter written in PowerShell.
$script_dir = Split-Path -parent $MyInvocation.MyCommand.Path
$embedded_dir = Join-Path $(Split-Path -parent $script_dir) "embedded"
$ruby = Join-Path $embedded_dir "bin/ruby"
$vagrant_executable = Join-Path $embedded_dir "gems/bin/vagrant"
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
$processStartInfo.FileName = $ruby
$processStartInfo.WorkingDirectory = (Get-Location).Path
@objectx
objectx / count_sloc.sh
Created April 26, 2013 11:50
Count the SLOC...
find . -type f \( -name "*.cpp" -o -name "*.c" -o -name "*.cxx" -o -name "*.h" \) -print | xargs -n 32 cat | wc -l
@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 <objectxtreme@gmail.com>
#
param ([switch]$WhatIf = $false, [switch]$Verbose = $false)
$groovydir = Split-Path -parent $MyInvocation.MyCommand.Path | Split-Path -parent