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
| object X extends App { | |
| def uniq[T](x: T) = | |
| new { | |
| type Q = this.type | |
| def e(x: Q) = () | |
| def q2(x: Q): String = "hello!" | |
| } | |
| val x = uniq(1) | |
| val y = uniq(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
| #! /bin/bash | |
| # | |
| # wondering how long bash would take to break https://github.com/Dirktheman/rsa-codeigniter-library/blob/master/application/libaries/Rsa.php#L33-L87 | |
| # answer: not long. | |
| # | |
| # > time ./test.sh | |
| # #primes found: | |
| # p: 9473, q: 9479 | |
| # | |
| # real 0m2.832s |
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 scala.reflect.macros.{Context, TypecheckException} | |
| import scala.reflect.runtime.universe._ | |
| import scala.language.experimental.macros | |
| import scala.util.{Success, Failure} | |
| import java.util.regex.Pattern | |
| /* | |
| * Heavily inspired by ShouldNotTypecheck (from slick) and |
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
| name := "sbt_playground" | |
| scalaVersion := "2.11.7" | |
| scalaSource in Compile := baseDirectory.value / "src" | |
| scalaSource in Test := baseDirectory.value / "test" | |
| libraryDependencies ++= Seq( | |
| "com.chuusai" %% "shapeless" % "2.2.5" |
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
| ; nasm -f macho -o pf.o | |
| ; ld pf.o | |
| ; ./a.out | |
| ; | |
| ; this probably works on linuxes too, i think exit and write should be the same. | |
| ; | |
| ; should produce: | |
| ; tears (2) | |
| ; 00000246 <-- eax = 0, xor by 0 | |
| ; 00000206 <-- xor ax, 0x0100 |
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
| using System.Runtime.InteropServices; | |
| using System.Reflection; | |
| using System; | |
| public class lol { | |
| internal delegate void lolwut(); | |
| static Delegate d; | |
| static MethodInfo info; | |
| static unsafe byte* rawptr; | |
| public static void Main(System.String[] args) { |
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
| ; assemble like `nasm bootloader.asm` (will produce a flat binary output by default) | |
| ; run like `qemu-system-x86_64 bootloader` | |
| [BITS 16] | |
| [ORG 7c00h] | |
| init: | |
| mov cx, 0xB800 | |
| mov gs, cx | |
| call clr_vga | |
| mov si, HELLO |
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
| ; build and run: `nasm segment_heccery.asm -f bin -o img.bin && qemu-system-x86_64 img.bin -s -S` | |
| [BITS 16] | |
| [ORG 7c00h] | |
| init: | |
| cli | |
| lgdt [gdtr] | |
| mov eax, cr0 | |
| or al, 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
| trait Person { | |
| fn greeting(&self) -> StateOfMind; | |
| fn name(&self) -> &'static str; | |
| } | |
| struct Ixi { } | |
| struct Katie { } | |
| #[derive(Debug)] | |
| enum StateOfMind { |
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 <signal.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <sys/ucontext.h> | |
| #include <stdint.h> | |
| void interpret(char op) { | |
| printf("interpreting %02x\n", op); | |
| } |