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 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
| [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3], [4], [1, 4], [2, 4], [1, 2, 4], [3, 4], [1, 3, 4], [2, 3, 4], [1, 2, 3, 4]] |
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
| int main(int argc, char *argv[]) | |
| { | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^(void) { | |
| size_t const BUFFER_SIZE = 2048; | |
| // Create a pipe | |
| int pipe_in_out[2]; | |
| if (pipe(pipe_in_out) == -1) | |
| return; |
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
| // A solution for http://www.geeksforgeeks.org/archives/25739 | |
| // | |
| // Given two numbers represented by two linked lists, write a function that | |
| // returns sum list. The sum list is linked list representation of addition of | |
| // two input numbers. It is not allowed to modify the lists. Also, not allowed | |
| // to use explicit extra space (Hint: Use Recursion). | |
| // | |
| // Example: | |
| // | |
| // Input: |
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 <vector> | |
| #include <limits> | |
| #include <iostream> | |
| struct Edge | |
| { | |
| Edge(size_t to, int cost) | |
| : to(to - 1) | |
| , cost(cost) | |
| {} |
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 | |
| class Coord | |
| attr_reader :x, :y | |
| def initialize x, y | |
| @x = x | |
| @y = y | |
| end |
OlderNewer