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/aes" | |
| import "fmt" | |
| import "encoding/hex" | |
| var start = []byte("AES-256 ECB mode twice, two keys") | |
| var end = []byte("\x4c\x76\xe9\x07\x86\xc4\xf3\x64\x6a\xdf\x99\x21\x7a\x64\xd0\xd7\x49\xed\xc5\x9f\x2c\x7f\xbb\x36\x58\xaf\x04\xaf\x07\x1d\x0c\x47") | |
| var reverse = make(map[string][32]byte) |
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 subprocess | |
| def shell(*args, **kwargs): | |
| """Execute a shell command and return the output as a string. | |
| Any additional kwargs are passed directly to subprocess.run. | |
| Examples: | |
| shell("date") | |
| shell("date", "-u") | |
| message = "hello, world" | |
| shell("echo", message) |
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
| # Comments in makefiles follow the same form as comments in bash. | |
| # Makefiles need to be named "Makefile" or "makefile". | |
| # In makefiles, variables are declared in the following manner (the entire | |
| # string after the equals and up to but excluding the newline is the | |
| # content of the variable) | |
| # | |
| # Note: there are other ways to declare variables that are not explored in this | |
| # tutorial. | |
| TARGET = my_cc |
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
| securityDefinitions: | |
| api_key: | |
| in: query | |
| name: key | |
| type: apiKey | |
| api_token: | |
| in: query | |
| name: token | |
| type: apiKey |
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
| void print_backtrace(int skip) { | |
| void *backtrace_array[MAX_STACK]; | |
| int stack_size = backtrace(backtrace_array, MAX_STACK); | |
| backtrace_symbols_fd(&backtrace_array[skip+1], | |
| stack_size - skip - 1, STDERR_FILENO); | |
| } | |
| void signal_backtrace(int signum) { | |
| fprintf(stderr, "%s\n\n", strsignal(signum)); | |
| print_backtrace(2); |
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 'digest' | |
| module VanitySha | |
| extend self | |
| COMMITTER_PATTERN = /^committer .* \<.*\> (?<timestamp>\d+)(?<timezone>.*$)/ | |
| AUTHOR_PATTERN = /^author .* \<.*\> (?<timestamp>\d+)(?<timezone>.*$)/ | |
| TIMESTAMP_DELTA_MAX = 10 * 24 * 60 * 60 |
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/python | |
| # -*- coding: utf-8 -*- | |
| import argparse | |
| import blessed | |
| from collections import defaultdict | |
| import csv | |
| import jinja2 | |
| import logging | |
| import numpy |
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
| CREATE TABLE metrics ( | |
| id bytea NOT NULL primary key, | |
| description text, | |
| name text COLLATE pg_catalog."C" | |
| ); | |
| CREATE TABLE contribution_metrics ( | |
| last_update_on timestamp with time zone, | |
| metric bytea NOT NULL, | |
| projected double precision, |
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
| psql> explain analyze select investments.id | |
| from contributions | |
| JOIN investments ON contributions.investment_id = investments.id | |
| JOIN contribution_investment_metrics cim on cim.investment_id = investments.id | |
| WHERE contributions.id = '\x58c9c0d3ee944c48b32f814d'; | |
| QUERY PLAN | |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| Nested Loop (cost=27098.32..27106.89 rows=1 width=13) (actual time=1322.324..1322.329 rows=1 loops=1) | |
| Join Filter: (contributions.investment_id = investments.id) | |
| -> Merge Join (cost=27098. |
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 gdb | |
| from datetime import datetime | |
| import sys | |
| if sys.version_info > (3, 0): | |
| raw_input = input | |
| # | |
| # The gdb constant COMPLETE_EXPRESSION was added in gdb 7.7. For earlier | |
| # version of gdb, we use COMPLETE_SYMBOL which is close enough. |
NewerOlder