Skip to content

Instantly share code, notes, and snippets.

Kenta Murata mrkn

View GitHub Profile
View gist:3d5dce6b9e1ad7eda9c0
ubuntu@ip-172-31-49-232:~/NVIDIA_CUDA-7.0_Samples$ bin/x86_64/linux/release/deviceQuery
bin/x86_64/linux/release/deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GRID K520"
CUDA Driver Version / Runtime Version 7.0 / 7.0
CUDA Capability Major/Minor version number: 3.0
View gist:8692143
GC_DEBUG = false
CHAR_BIT = 8
BITS_SIZE = 8
BITS_BITLENGTH = BITS_SIZE * CHAR_BIT
SIZEOF_RVALUE = GC_DEBUG ? 56 : 40
SIZEOF_SIZE_T = 8
SIZEOF_STRUCT_HEAP_PAGE_HEADER = 8
def ceildiv(i, mod)
View gist:8711146
require 'active_record'
ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',
database: 'test',
)
class Migration < ActiveRecord::Migration
def up
drop_table :users rescue nil
View ruby-1.9.3-codesign.patch
diff --git a/ChangeLog b/ChangeLog
index e1a43e5..7879e10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Thu Feb 6 09:06:00 2014 Kenta Murata <mrkn@cookpad.com>
+
+ * configure.in (POSTLINK): sign built program using RUBY_CODESIGN identity.
+
+ * Makefile.in (PROGRAM): ditto.
View gist:8864745
module RefineInteger
refine Fixnum do
def /(other)
case other
when Integer
Rational(self, other)
else
super
end
end
View gist:9265862
--- hash.c.orig 2014-02-28 14:05:25.000000000 +0900
+++ hash.c 2014-02-28 14:06:08.000000000 +0900
@@ -1178,7 +1178,7 @@
#endif
}
}
-#if HASH_REJECT_COPY_MISC_ATTRIBUTES
+#if HASH_REJECT_COPY_EXTRA_STATES
result = rb_hash_dup_empty(hash);
#else
View gist:10265611
require 'thread'
queue = Queue.new
thread = Thread.start do
loop do
queue.pop.call
end
end
View phantomjs.patch
commit 30b34746b1c90c6085a0fc553adc9f4acb192345
Author: Kenta Murata <mrkn@cookpad.com>
Date: Fri Jul 18 16:35:59 2014 +0200
Prevent to break cookie domain
diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp
index a953d4b..eb9e3ba 100644
--- a/src/cookiejar.cpp
+++ b/src/cookiejar.cpp
View gist:20322
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/dir.h>
int
main(int argc, char** argv)
{
View gist:20330
/* gcc -framework Foundation -framework AppKit -o file_wo_kesu file_wo_kesu.m */
#import <Foundation/NSArray.h>
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSFileManager.h>
#import <Foundation/NSProcessInfo.h>
#import <Foundation/NSString.h>
#import <AppKit/NSOpenPanel.h>
You can’t perform that action at this time.