Skip to content

Instantly share code, notes, and snippets.

View allencch's full-sized avatar
💭
天地玄黄。宇宙洪荒。

Allen allencch

💭
天地玄黄。宇宙洪荒。
View GitHub Profile
@allencch
allencch / hades-cheat.diff
Created March 14, 2021 05:41
Hades Lua script cheat
diff --git a/Combat.lua b/Combat.lua
index d9df948..2cc3e32 100644
--- a/Combat.lua
+++ b/Combat.lua
@@ -867,6 +867,7 @@ function DamageEnemy( victim, triggerArgs )
end
end
+ triggerArgs.DamageAmount = triggerArgs.DamageAmount * 10
if triggerArgs.DamageAmount == 0 then
@allencch
allencch / wine_wrapper.sh
Last active January 11, 2020 09:59
Wine wrapper
#!/bin/bash
_WINEARCH=win64
_WINEPREFIX="$HOME/.wine"
_WINEDLLOVERRIDES="winemenubuilder.exe=d;mscoree;mshtml"
_WINEDEBUG=fixme-all
_WINEPATH=""
_WINEBIN=wine
CALL_WINETRICKS=false
CALL_CONSOLE=false
CALL_SHUTDOWN=false
@allencch
allencch / rename_files_to_date.pl
Created September 16, 2018 16:28
Rename files according to the date
#!/usr/bin/perl -w
use strict;
use warnings;
use POSIX 'strftime';
use File::Basename;
sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
sub get_files_from_directory {
my $path = $_[0];
@allencch
allencch / robust_flip_coin.py
Created March 15, 2018 03:49
Flip coin conundrum for any length
#!/usr/bin/env python
import random
import unittest
# 0 = Head, 1 = Tail
def start_flipping_coin(target, saved):
return flip_until(target, 0, 0, saved)
@allencch
allencch / flip_coin.py
Last active March 14, 2018 14:01
Coin Flip Conundrum
#!/usr/bin/env python
import random
# 0 = Head, 1 = Tail
def start_flipping_coin(target, saved):
return flip_until(target, 0, 0, saved)
@allencch
allencch / monty_hall.py
Created March 14, 2018 10:24
Monty Hall
#!/usr/bin/env python
# This is simulating Monty Hall Paradox
import random
def monty(switch):
# random shuffle
doors = [0, 0, 1] # one of the door contains the car
random.shuffle(doors)
@allencch
allencch / frog_riddle.py
Last active March 14, 2018 10:19
Frog Riddle
#!/usr/bin/env python
import random
# Frog 0 for female, 1 for male
def create_frog():
return random.randint(0, 1)
def has_croak(pairs): # also male
return 1 in pairs
@allencch
allencch / hed.c
Created March 6, 2018 00:40
Hex edit target for Android
/*************
Copyright (c) 2012, Allen Choong
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
;;; org-mode-extend --- Extra org-mode functions
;;; Commentary:
;;; Code:
(defun org-outline-to-checklist (start end)
"Convert outline to checklist from START to END."
(interactive "r")
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))