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
| -- | |
| -- Steps taken to solve https://mystery.knightlab.com/ | |
| -- | |
| SELECT description | |
| FROM crime_scene_report | |
| WHERE type = "murder" | |
| AND city = "SQL City" | |
| AND date = 20180115 | |
| ; |
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 | |
| def sort_ver(vers) | |
| vers.sort do |v1, v2| | |
| v1_info = v1.split(?.).map &:to_i | |
| v2_info = v2.split(?.).map &:to_i | |
| ord_found = 0 | |
| while ord_found.zero? and not v1_info.empty? and not v2_info.empty? | |
| ord_found = v2_info.first <=> v1_info.first |
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 | |
| WORDS = File.open("/usr/share/dict/words", &:read).lines.map do |word| | |
| word.strip.downcase | |
| end.freeze | |
| def word?(word) | |
| WORDS.include? word.downcase | |
| 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
| #!/usr/bin/env perl | |
| foreach $arg (0..$#ARGV) { | |
| my $num = int($ARGV[$arg]); | |
| my $fmt = "", $cnt = 0; | |
| while($num > 0) { | |
| $fmt = ($num % 10) . $fmt; | |
| if(++$cnt % 3 == 0 and $num >= 10) { |
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 ( | |
| "crypto/x509" | |
| _ "embed" | |
| "encoding/base64" | |
| "errors" | |
| "flag" | |
| "fmt" | |
| "io" |
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
| import sys | |
| def padlen(number): | |
| return ((16 - (number % 16)) * 3) + 1 + int(number % 16 < 8) | |
| def hexdump(data): | |
| printed = [] | |
| print(f"{0:08x}", 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
| import collections | |
| import sys | |
| DIGITS = { | |
| "1": ["one", "ten", "eleven"], | |
| "2": ["two", "twenty", "twelve"], | |
| "3": ["three", "thirty", "thirteen"], | |
| "4": ["four", "forty", "fourteen"], | |
| "5": ["five", "fifty", "fifteen"], | |
| "6": ["six", "sixty", "sixteen"], |
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 <arpa/inet.h> | |
| #include <errno.h> | |
| #include <fcntl.h> | |
| #include <loadables.h> | |
| #include <netinet/in.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/select.h> | |
| #include <sys/socket.h> |
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
| // not uniq(1) | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <ctype.h> | |
| const char *unique(const char *str, const char **dup) { | |
| const char *alphabet[26] = { NULL }; | |
| for(; *str; str += 1) { |
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 <limits.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| static uint64_t pad_length(uint64_t len) { | |
| uint64_t space_needed = 1; | |
| while(((len + space_needed) % 64) != 56) { |
OlderNewer