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
| Map without reserve | |
| size: 0 | |
| bucket_count: 23 | |
| load_factor: 0 | |
| Allocation count: 0 | |
| size: 0 | |
| bucket_count: 23 |
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
| $ clang -c test.cpp; gcc -c test.cpp | |
| test.cpp:10:7: error: read-only variable is not assignable | |
| x = 0; | |
| ~ ^ | |
| test.cpp:26:7: note: in instantiation of member function 'A<float>::f' requested here | |
| a.f(0); | |
| ^ | |
| 1 error generated. |
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
| #!/bin/sh | |
| arm-linux-gnueabi-g++ -o yo -static main.cpp | |
| adb push yo /storage/sdcard0/Android/data/ | |
| adb shell su -c "cd /storage/sdcard0/Android/data; cp yo /data/local/; rm yo; cd /data/local; chmod 751 yo; ./yo; rm yo" |
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
| #!/usr/bin/env ruby | |
| require "rake" | |
| require "colored" | |
| abort "Usage: to-git hg-repo git-repo" if ARGV.size != 2 | |
| SOURCE = ARGV[0] | |
| DESTINATION = ARGV[1] | |
| def hg params |
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
| #!/usr/bin/env ruby | |
| min_width = `identify *.jpg` | |
| .split("\n") | |
| .map { |i| i[/JPEG (\d+x\d+)/, 1] } | |
| .map { |i| i.split "x" } | |
| .transpose[0] | |
| .map { |i| i.to_i } | |
| .min |
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
| #!/usr/bin/env ruby | |
| # This script sorts static libraries in the topological order suitable for | |
| # passing to ld. No need for --start-group/--end-group anymore. Should speed | |
| # up the linking a bit. When the libraries contain actual circular dependecies | |
| # the script will detect minimal groups of those and surround them with | |
| # --start-group/--end-group. | |
| # | |
| # To run you need Linux (maybe OS X), Ruby 1.9+ and the rgl gem installed: | |
| # |
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
| #!/usr/bin/env ruby | |
| # This script rotates AWS credentials. | |
| # It's very quick and dirty and unsafe. | |
| # It's possible that something is gonna fail along the way and you're | |
| # gonna end up with broken or no credentials at all. You can always fix | |
| # them from the AWS dashboard later. | |
| # The script expects ~/bin/aws-credentials to be present and executable. | |
| # This file is overwritten with the new credentials at the 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
| function printHexDump(s) { | |
| const W = 16 | |
| let bytes = Buffer.from(s) | |
| for (let i = 0; i < bytes.length;) { | |
| let hexRow = [] | |
| let asciiRow = [] | |
| let rowOffset = i |
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
| #include <functional> | |
| #include <set> | |
| #include <string> | |
| #include <vector> | |
| #include <iostream> | |
| #include <unistd.h> | |
| #include <sys/wait.h> | |
| void | |
| run_all( const std::vector< std::string >& source_files, |
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
| #!/usr/bin/env ruby | |
| # This script makes a series of A3 posters for cutting from a bunch of images. | |
| require "rational" | |
| R_4_3 = Rational(4, 3) | |
| R_3_4 = Rational(3, 4) | |
| system "rm -rf out" |