Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / wixoss.m
Created June 27, 2014 18:27
#include <Foundation/Foundation.h>
int main()
{
printf("%s\n", @selector(infectedWIXOSS:));
return 0;
}
/*
@masami256
masami256 / arch_build.patch
Created July 1, 2014 14:43
archでOSvをビルドするhackなパッチ
diff --git a/scripts/osv/modules/api.py b/scripts/osv/modules/api.py
index 59a709d..7b88415 100644
--- a/scripts/osv/modules/api.py
+++ b/scripts/osv/modules/api.py
@@ -29,7 +29,7 @@ class java_app(object):
def _to_args_list(text_or_list):
if not text_or_list:
return []
- if isinstance(text_or_list, basestring):
+ if isinstance(text_or_list, str):
@lmullen
lmullen / Makefile
Last active May 30, 2024 09:34
PDF slides and handouts using Pandoc and Beamer
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@karubabu
karubabu / SKK-JISYO.mahjong.patch
Created September 23, 2017 14:53
SKK-JISYO.mahjong.patch
*** SKK-JISYO.mahjong 2017-09-23 23:40:44.398832446 +0900
--- SKK-JISYO-new.mahjong 2017-09-23 23:43:31.818838527 +0900
***************
*** 1,3 ****
--- 1,6 ----
+ ;;; -*- coding: utf-8 -*-
+ ;; okuri-ari entries.
+ ;; okuri-nasi entries.
やくまん /役満;[麻雀]/
さんばいまん /三倍満;[麻雀]/
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@cerebrate
cerebrate / README.md
Last active July 11, 2024 04:17
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@xerpi
xerpi / PSVita_Linux_build_instructions.md
Last active April 1, 2024 12:51
PSVita Linux build instructions
@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active July 17, 2024 16:11
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)