Skip to content

Instantly share code, notes, and snippets.

View bounties.md

Breaking the Mold: Jo King

Best Explanation: Mego

Wrong Tool for the Job: Adám

Most Helpful Commenter: Mego

Best Above-and-Beyond Answer: Adám

@Mego
Mego / winners.md
Created May 12, 2019
Best of PPCG 2018 Winners
View winners.md
@Mego
Mego / PHP Stupidity.md
Last active Apr 17, 2018
stupid php stuff
View PHP Stupidity.md
  • Variable variables
  • Loop by-ref followed by loop by-val
  • Leaky loop scopes
  • Closures not actually being closures
  • 0 == "foo"
View Axtell-todo.md
  • Basic Webserver
    • Flask for serving content
    • nginx and uWSGI for hosting server
    • LetsEncrypt for HTTPS
  • Database backend
    • MySQL database created
    • MySQL users and roles created
    • SQLAlchemy setup
  • Google OpenID login
    • Login with Google account
View budget_flip.py
#!/usr/bin/env python3
import math
import random
successes = 0
history = []
n = random.randint(1, 256)
k = random.randint(1, n)
B = 0
@Mego
Mego / complex_dice.py
Last active Jul 24, 2017
Overly complex dice rolling for D&D
View complex_dice.py
#!/usr/bin/env python3
import re
from random import randint, seed
from collections import Iterable
from functools import total_ordering
def as_list(x):
if isinstance(x, Iterable):
return list(x)
View hw.exe.txt
00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000 MZ..............
00000010: b800 0000 0000 0000 4000 0000 0000 0000 ........@.......
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 8000 0000 ................
00000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468 ........!..L.!Th
00000050: 6973 2070 726f 6772 616d 2063 616e 6e6f is program canno
00000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS
00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode....$.......
00000080: 5045 0000 4c01 0e00 56f3 d158 00b0 0000 PE..L...V..X....
00000090: 7f02 0000 e000 2701 0b01 021a 0008 0000 ......'.........
View hello.exe.txt
00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000 MZ..............
00000010: b800 0000 0000 0000 4000 0000 0000 0000 ........@.......
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 0001 0000 ................
00000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468 ........!..L.!Th
00000050: 6973 2070 726f 6772 616d 2063 616e 6e6f is program canno
00000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS
00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode....$.......
00000080: dec0 545d 9aa1 3a0e 9aa1 3a0e 9aa1 3a0e ..T]..:...:...:.
00000090: 93d9 a90e 90a1 3a0e a1ff 3b0f 99a1 3a0e ......:...;...:.
View seriously_updates.md

October

  • Repeat combinator (¶): pop n, repeat the next command n times
  • Small compatibility fixes for pypy3
  • Removed compression and decompression commands (formerly ⌠ and ⌡)
  • -N command-line flag to ignore input
  • Make pycryptodome optional
  • Better Travis CI setup
  • Better detection of whether or not the stats package from pypi is needed
  • Add factor with multiplicity to o command
  • Bug fixes:
View ptr.c
#include <stdio.h>
int main() {
int foo = 2;
int* bar = &foo;
int baz = (int) bar;
printf("%d\n", baz);
return 0;
}
You can’t perform that action at this time.