Skip to content

Instantly share code, notes, and snippets.

View nodokaha's full-sized avatar

のどかは(望み通り叶えては) nodokaha

View GitHub Profile
q='q%s%s%s%s=;$a="q%s%s%s%s=";$b=chr(39);$c=chr(34);$d=chr(92);$_=q(print qq(q=$b$a;\$a=$c$a$c;\$b=chr(39);\$c=chr(34);\$d=chr(92);\$_=q($_);eval;print q#));eval;print q#;print((q[:9]%(chr(61),chr(39),q,chr(39))+q[-59:])+chr(35))';print((q[:9]%(chr(61),chr(39),q,chr(39))+q[-59:])+chr(35))#;$a=';#$a=%c%s%c;printf($a,39,$a,39);';printf($a,39,$a,39);
@nodokaha
nodokaha / onelineVM.py
Last active August 31, 2024 15:50
python oneliner VM
v={};g=[];pop=(lambda x:x if type(x)==int else int(x) if type(x)==str and x.isdecimal() else x if type(x)==list else v.get(x));eval=(lambda x:(g.append(input('input:>')),g.pop())[1]if x=='io'else(g.append(pop(g.pop())+pop(g.pop())),g.pop())[1]if x=='plus'else(g.append(g[-1:][0]),g.pop())[1]if x=='copy'else(g.append(int(g.pop())),g.pop())[1]if x=='str->int'else(g.append(chr(g.pop())),g.pop())[1]if x=='int->chr'else(v.update([(g.pop(),eval(str(g.pop())))]),'eval')[1]if x=='def'and(not g[-1:][0].isdecimal())else(print(pop(g.pop())),'eval')[1]if x=='pop'else(g.append(g[0:g.pop()]),g.pop())[1]if x=='args'else(g.extend(pop(g.pop())),g.pop())[1]if x=='apply'else(g.append(['io','plus','copy','str->int','int->chr','def','pop','args','code','eval'][g.pop()]),'eval')[1]if x=='code'else(eval(g.pop()),g.pop())[1]if x=='eval'else(g.append(int(x)),int(x))[1]if x.isdecimal()else(g.append(x),x)[1]);[eval(x)for x in input().split(' ')]
@nodokaha
nodokaha / gist:340c015bf5691a5f5538e5a6252d78a2
Last active January 1, 2025 17:34
perl-python3-polyglot-quine(WIP)
q='q%s%s%s%s=;$a="q%s%s%s%s=";$b=chr(39);$c=chr(34);$d=chr(92);$_=q(print qq(q=$b$a;\$a=$c$a$c;\$b=chr(39);\$c=chr(34);\$d=chr(92);\$_=q($_);eval;print q#));eval;print q#;print((q[:9]%(chr(61),chr(39),q,chr(39))+q[-152:])+chr(35)+";$f="+chr(39)+chr(35)+";"+"$f=%c%s%c;printf($f,39,$f,39);"+chr(39)+";printf($f,39,$f,39);")';print((q[:9]%(chr(61),chr(39),q,chr(39))+q[-152:])+chr(35)+";$f="+chr(39)+chr(35)+";"+"$f=%c%s%c;printf($f,39,$f,39);"+chr(39)+";printf($f,39,$f,39);")#;$f='#;$f=%c%s%c;printf($f,39,$f,39);';printf($f,39,$f,39);
;;; -*- lexical-binding: t -*-
;; (require 'profiler)
;; (profiler-start 'cpu)
(setq gc-cons-percentage 0.5)
(setq gc-cons-threshold most-positive-fixnum)
(defun my-function-list-p (val)
(or (null val) (and (consp val) (not (eq (car val) 'lambda)))))
;; 重複チェックしない add-hook
@nodokaha
nodokaha / white.ws
Created March 14, 2024 17:00
white
@nodokaha
nodokaha / C<->Scheme.scm
Created January 28, 2024 14:21
C<->Scheme
(map display ((lambda (x) (quasiquote (main (unquote (integer->char 40)) void (unquote (integer->char 41)) (unquote (integer->char 123)) printf (unquote (integer->char 40)) (unquote (integer->char 34)) (unquote (integer->char 40)) map (unquote (integer->char 32)) display (unquote (integer->char 32)) (unquote (integer->char 40)) (unquote x) (quote (unquote x)) (unquote (integer->char 41)) (unquote (integer->char 34)) (unquote (integer->char 41)) (unquote (integer->char 59)) printf (unquote (integer->char 40)) (unquote (integer->char 34)) (unquote (integer->char 41)) (unquote (integer->char 34)) (unquote (integer->char 41)) (unquote (integer->char 59)) (unquote (integer->char 125)))))(quote (lambda (x) (quasiquote (main (unquote (integer->char 40)) void (unquote (integer->char 41)) (unquote (integer->char 123)) printf (unquote (integer->char 40)) (unquote (integer->char 34)) (unquote (integer->char 40)) map (unquote (integer->char 32)) display (unquote (integer->char 32)) (unquote (integer->char 40)) (unquote x
@nodokaha
nodokaha / init.el
Created January 24, 2024 18:44
default-emacs-minimal-settings
(require 'spacemacs-theme-autoloads)
(require 'kind-icon-autoloads)
(require 'vertico-autoloads)
(require 'vertico-posframe-autoloads)
(require 'vertico-directory)
(require 'corfu-autoloads)
(require 'consult-autoloads)
(require 'rainbow-delimiters-autoloads)
(require 'marginalia-autoloads)
(require 'orderless-autoloads)
@nodokaha
nodokaha / quine-C-rust-python3-scheme.c
Created January 22, 2024 01:08
quine-C-rust-python3-scheme
main(void){char*s="fn main(){let a=%cprint(%c%c(let ((a %c%c%c%cmain(void){char*s=%c%c%c%c%c%c%s%c%c%c%c%c%c;printf(s,34,92,39,92,92,92,34,92,92,92,92,92,34,s,92,92,92,92,92,34,92,92,92,34,92,39,34,34,34);}%c%c%c%c)) (display a))%c%c)%c; println!(%c{}%c,a)}";printf(s,34,92,39,92,92,92,34,92,92,92,92,92,34,s,92,92,92,92,92,34,92,92,92,34,92,39,34,34,34);}
;;; magloader.el --- MAKI02 viewer -*- lexical-binding: nil; -*-
;; Copyright (C) 2024 nodokaha
;; Author: nodokaha <scpeee@wail.ch>
;; Keywords: lisp
;; Version: 0.0.1
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
{ pkgs, lib, ... }:
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"discord"
"google-chrome"
"microsoft-edge-stable"
"stegsolve"
"teams"
"cider"
"postman"