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
| # The fact that YAML.load will instantiate arbitrary ruby objects | |
| # means that calling `YAML.load` on untrusted data is virtually always | |
| # equivalent to executing arbitrary code in a complex app. | |
| # This code fragment globally neuters YAML to disable this behavior, | |
| # which should (hopefully) cut off all such attacks from the start. | |
| # I don't promise this closes all possible attacks, but this closes | |
| # off the trivial case. You should audit and upgrade all your | |
| # dependencies, as well. |
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
| case 'G': | |
| if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR)) break; | |
| tok->type = TK_ANCHOR; | |
| tok->u.subtype = ANCHOR_BEGIN_POSITION; | |
| break; | |
| // elsewhere | |
| case '^': | |
| if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break; | |
| tok->type = TK_ANCHOR; |
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
| Normally, this header is included in most HTTP requests (and | |
| preserved across HTTP-level redirects), except in the following | |
| scenarios: | |
| â After organically entering a new URL into the address bar or | |
| opening a bookmarked page. | |
| â When the navigation originates from a pseudo-URL document, such | |
| as data: or javascript:. | |
| â When the request is a result of redirection controlled by the | |
| Refresh header (but not a Location-based one). | |
| â Whenever the referring site is encrypted but the requested page |
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
| for o in $(find .git/objects -ctime -2 -type f); | |
| do o=$(basename "$(dirname "$o")")"$(basename "$o")"; | |
| if [ "$(git cat-file -t "$o")" = "blob" ]; then | |
| if git cat-file blob $o | grep SOME-WORD; then | |
| echo ">> $o"; | |
| fi; | |
| fi; | |
| done |
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
| (require 'ido) | |
| (setq ido-max-directory-size (* 256 1024) | |
| ido-enable-flex-matching t) | |
| (defun chomp (str) | |
| "Chomp leading and tailing whitespace from STR." | |
| (while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" | |
| str) | |
| (setq str (replace-match "" t t str))) | |
| str) |
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 callblock (&block) | |
| block.call | |
| puts "block.call returned normally" | |
| end | |
| def yieldblock (&block) | |
| yield | |
| puts "yield returned normally" | |
| 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
| /* | |
| * $ gcc -m32 -fPIC -shared -o regdump.so regdump.c | |
| * $ LD_PRELOAD=$(pwd)/regdump.so ./test | |
| * | |
| * Dump register state with 'ud2a' (0F 0B) | |
| */ | |
| #define _GNU_SOURCE | |
| #include <signal.h> | |
| #include <stdlib.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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| struct doit_kwargs { | |
| int a, b, c; | |
| }; | |
| void __doit(struct doit_kwargs kw) { | |
| printf("%d %d %d\n", kw.a, kw.b, kw.c); | |
| } |
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 <stdlib.h> | |
| #include <stdio.h> | |
| #define NALLOC (1 << 10) | |
| #define ALLOCSZ (1 << 12) | |
| int main(void) { | |
| void *buffers[NALLOC]; | |
| int 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
| fluid-let |