Skip to content

Instantly share code, notes, and snippets.

View failamir's full-sized avatar
😁
Im Fool

failamir failamir

😁
Im Fool
View GitHub Profile
@failamir
failamir / php-Knuth-Morris.php
Created August 9, 2020 21:49 — forked from fatkulnurk/php-Knuth-Morris.php
Algoritma Knuth-Morris-Pratt
<?php
// Referensi :
// https://id.wikipedia.org/wiki/Algoritma_Knuth-Morris-Pratt
// https://stackoverflow.com/questions/44081348/is-it-possible-to-use-knuth-morris-pratt-algorithm-for-string-matching-on-text-t
// http://www.elangsakti.com/2013/03/implementasi-algoritma-string-matching.html
// https://stackoverflow.com/questions/29439930/knuth-morris-pratt-string-search-algorithm
// https://stackoverflow.com/questions/5873935/how-to-optimize-knuth-morris-pratt-string-matching-algorithm
// https://stackoverflow.com/questions/13271856/understanding-knuth-morris-pratt-algorithm
//
//
@failamir
failamir / kmp_match.php
Created August 9, 2020 21:46 — forked from white-gecko/kmp_match.php
Knuth-Morris-Pratt-Algorithm
<?php
/**
* This is an implementation of the Knuth-Morris-Pratt-Algorithm as in
* Thomas H. Cormen et. al.: "Algorithmen - Eine Einführung"
* (German version by Paul Molitor) 3. Auflage, page 1017
*
* My changes:
* - Indexes starting with 0
* - overlapping matches are recognized
*/
@failamir
failamir / key.md
Created January 1, 2020 10:26
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@failamir
failamir / AES-256 encryption and decryption in PHP and C#.md
Created November 2, 2018 14:02
AES-256 encryption and decryption in PHP and C#

AES-256 encryption and decryption in PHP and C#

Update: There is a more secure version available. Details

PHP

<?php

$plaintext = 'My secret message 1234';