Skip to content

Instantly share code, notes, and snippets.

View gahfy's full-sized avatar

Gahfy gahfy

View GitHub Profile
@gahfy
gahfy / john-1.9.0-jumbo-1-f55f420-fix-python-env.patch
Last active February 24, 2024 08:44
Patch for Python environment for John Jumbo commit f55f420
diff -ruN a/run/1password2john.py b/run/1password2john.py
--- a/run/1password2john.py 2024-02-03 03:18:48
+++ b/run/1password2john.py 2024-02-24 17:05:12
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Written by Dhiru Kholia <dhiru at openwall.com> in July 2012 for JtR project.
# Copyright (c) 2012-2013, Dhiru Kholia.
diff -ruN a/run/DPAPImk2john.py b/run/DPAPImk2john.py
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
int main() {
// Le message "Hello World" à compresser
const char *message = "Hello World";
// Données pour la compression
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bzlib.h>
int main() {
// Le message "Hello World" à compresser
const char *message = "Hello World";
// Données pour la compression
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -19,7 +19,7 @@
if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")
if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
# Arch 'i386' no longer works in Xcode 10.
- set(CMAKE_OSX_ARCHITECTURES x86_64)
+ set(CMAKE_OSX_ARCHITECTURES x86_64 arm64)
elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4)
fun main(){
print("What is your country? ")
val country = readLine()
val addressStrategy = if(country == "US") getUsAddressStrategy() else getOtherCountryAddressStrategy()
return addressStrategy.promptAddress()
}
fun getOtherCountryAddressStrategy() = AddressStrategy{
print("Please enter your zipCode: ")
readLine()
print("Please enter your city: ")
readLine()
print("Please enter your street address: ")
readLine()
}
fun getUsAddressStrategy() = AddressStrategy{
print("Please enter your state: ")
readLine()
print("Please enter your zipCode: ")
readLine()
print("Please enter your city: ")
readLine()
print("Please enter your street address: ")
readLine()
}
@gahfy
gahfy / Address.kt
Last active December 15, 2020 04:14
fun interface AddressStrategy{
fun promptAddress()
}
fun main(){
val context = StateContext()
val test1 = "123."
val test2 = "123er45"
val test3 = "-145.36"
println("$test1 is ${if(context.parseString(test1)) "" else "not "}a valid number.")
println("$test2 is ${if(context.parseString(test2)) "" else "not "}a valid number.")
println("$test3 is ${if(context.parseString(test3)) "" else "not "}a valid number.")
}
class StateContext {
private var state: State? = null
fun setState(state: State?){
this.state = state
}
public fun parseString(number: String): Boolean{
setState(InitialState())
for(character in number){