This file contains hidden or 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
| time_start = process.hrtime! | |
| String::replaceAt = (idx, c) -> | |
| @substr(0, idx) + c + @substr(idx + c.length) | |
| PF = require \pathfinding | |
| fs = require \fs | |
| read-map = -> | |
| arr = fs.readFileSync it, \ascii |> (.split \\n) | |
| idx = 0 |
This file contains hidden or 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
| $ qmake-qt4 -spec linux-g++-32 && make | |
| /usr/lib64/qt4/bin/uic aboutdialog.ui -o ui_aboutdialog.h | |
| /usr/lib64/qt4/bin/uic settingsdialog.ui -o ui_settingsdialog.h | |
| g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -fPIC -DSKYPETABNG_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++-32 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o mainwindow.o mainwindow.cpp | |
| g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -fPIC -DSKYPETABNG_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++-32 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o x11int.o x11int.cpp | |
| g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buf |
This file contains hidden or 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
| # http://stackoverflow.com/questions/9739654/rake-assetsprecompile-taking-extremely-long-to-complete | |
| # nocompress | |
| module Sass | |
| module Rails | |
| class CssCompressor | |
| def compress(css) | |
| css | |
| end | |
| end |
This file contains hidden or 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
| $ ruby test_server.rb -e production -p 9000 -d | |
| $ ab -n 5000 -c 1000 http://localhost:9000/ | |
| This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
| Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
| Licensed to The Apache Software Foundation, http://www.apache.org/ | |
| Benchmarking localhost (be patient) | |
| Completed 500 requests | |
| Completed 1000 requests |
This file contains hidden or 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
| def index | |
| @rooms = Room.includes :user | |
| result = [] | |
| @rooms.each do |room| | |
| el1 = {} | |
| el2 = {} | |
| Room.column_names.each { |col| el1[col] = room.send col } | |
| User.column_names.each { |col| el2[col] = room.user.send col } | |
| result << el1.merge(user: el2) |
This file contains hidden or 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
| diff -Naur unity-2d.orig//unity-2d-4.12.0/launcher/app/launcherview.cpp unity-2d/unity-2d-4.12.0/launcher/app/launcherview.cpp | |
| --- unity-2d.orig//unity-2d-4.12.0/launcher/app/launcherview.cpp 2011-09-29 18:12:44.000000000 +0400 | |
| +++ unity-2d/unity-2d-4.12.0/launcher/app/launcherview.cpp 2011-11-09 23:00:07.008801565 +0400 | |
| @@ -164,7 +164,7 @@ | |
| /* If the key is released, and was not being held, it means that the user just | |
| performed a "tap". Unless we're told to ignore that tap, that is. */ | |
| if (!m_superKeyHeld && !m_superPressIgnored) { | |
| - Q_EMIT superKeyTapped(); | |
| + //Q_EMIT superKeyTapped(); | |
| } |
This file contains hidden or 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
| entity2order :: Ant -> Point -> [Order] | |
| entity2order a food = let xant = snd.point $ a | |
| yant = fst.point $ a | |
| xfood = snd food | |
| yfood = fst food | |
| in case compare xant xfood of | |
| GT -> map (Order a) (directionClockWise West) | |
| LT -> map (Order a) (directionClockWise East) | |
| EQ -> case compare yant yfood of | |
| GT -> map (Order a) (directionClockWise North) |
This file contains hidden or 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
| (defun ac-go-candidates () | |
| (ac-go-autocomplete)) | |
| (defvar ac-source-go | |
| '((candidates . ac-go-candidates) | |
| (prefix . "\\.\\(.*\\)") | |
| (requires . 0))) | |
| (defun ac-go-get-candidate-strings (tmpbuf) | |
| (split-string (with-current-buffer tmpbuf (buffer-string)) "\n")) |
This file contains hidden or 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 main | |
| import "fmt" | |
| func main() { | |
| var x byte | |
| for { | |
| fmt.Scan("%c", &x) | |
| fmt.Printf("\nGot: '%c'\n", x) | |
| } |
This file contains hidden or 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
| cirno@perfect-math-class ~/sources/gollvm $ make | |
| CGOPKGPATH= cgo -- `llvm-config --cflags` core.go executionengine.go target.go transforms_scalar.go transforms_ipo.go analysis.go bitwriter.go | |
| error: 'LLVMInitializeCppBackendTargetInfo' undeclared (first use in this function) | |
| error: (Each undeclared identifier is reported only once | |
| error: 'LLVMInitializeARMTargetInfo' undeclared (first use in this function) | |
| error: 'LLVMInitializeCellSPUTarget' undeclared (first use in this function) | |
| error: 'LLVMInitializePowerPCTargetInfo' undeclared (first use in this function) | |
| error: 'LLVMInitializeCBackendTargetInfo' undeclared (first use in this function) | |
| error: 'LLVMInitializeAlphaTargetInfo' undeclared (first use in this function) | |
| error: 'LLVMInitializeMBlazeTargetInfo' undeclared (first use in this function) |