Skip to content

Instantly share code, notes, and snippets.

View Lucent's full-sized avatar

Michael Dayah Lucent

View GitHub Profile
@Lucent
Lucent / wikifight.aspx
Created November 30, 2019 22:47
Compare the length of two Wikipedia articles
<%@ Page EnableViewState="false" EnableEventValidation="false" Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
Sub Page_Load(Src as object, E as EventArgs)
End Sub
Sub btnRunQuery_OnClick(Sender As Object, E As EventArgs)
Dim objConnection As OleDbConnection
@Lucent
Lucent / generate_passwords.php
Created December 9, 2018 08:03
Removing ambiguous characters is the same as never including them
<?php
$LENGTH = 4;
$SAMPLES = 100000;
$all = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$ambig = ["l","1","I","o","O","0"];
$unambig = str_replace($ambig, "", $all);
function generate_passwords($remove, $set, $length, $samples) {
global $ambig;
$numbers_yes = 0;
Verifying my identity on Peepeth.com 0x4e6dddefc6047242128697caf28bdfec6c845337
@Lucent
Lucent / declutter_logic.js
Last active August 21, 2018 01:23
Create lists of nonoverlapping plane datablocks
function move_overlaps_higher(overlaps) {
cycle_list[0] = overlaps;
var another_row_needed = true;
for (var cyclerow = 0; another_row_needed; cyclerow++) {
another_row_needed = false;
var this_row = cycle_list[cyclerow];
for (var ident = 0; ident < this_row.length; ident++) {
for (var x = ident - 1; x >= 0; x--) {
if (x < 0) continue;
@Lucent
Lucent / cd_interest.php
Last active August 21, 2018 01:06
Calculate CD interest over term
<?
setlocale(LC_MONETARY, "en_US");
$cd_list = array(
array("Principal" => 250000, "Interest" => 5.05, "Start" => "27 Apr 2007", "Term" => "6 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.10, "Start" => "27 Apr 2007", "Term" => "9 months", "Interest Term" => "9 months"),
array("Principal" => 250000, "Interest" => 5.20, "Start" => "27 Apr 2007", "Term" => "12 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.00, "Start" => "27 Apr 2007", "Term" => "90 days", "Interest Term" => "90 days")
);
$total = 0;
@Lucent
Lucent / journal_search.php
Created August 19, 2018 04:11
Search and cleanup LiveJournal entries
<?php
if ($_GET["password"] != "password") { ?>
<p>Private search feature. Intrusion logged.</p>
<?php
return; }
set_time_limit(300);
$journal_dir = "C:\documents and settings\michael dayah\my documents\lj backup";
$username = "lucent";
$entry_array = array ();
@Lucent
Lucent / logprism.pl
Created August 18, 2018 17:12
Custom logprism for Ptable
#!/usr/bin/perl -w
#=============================================================================
#
# Copyright (C) 2005 - 2007, Matti Tukiainen, http://ktmatu.com/mt/
#
# Program name : LogPrism (logprism.pl)
# Version : 2.03
# Purpose : LogPrism turns Apache access log files (combined) into
# easy to read color highlighted format where user
# sessions, error status codes, external referrers and
Verifying my Blockstack ID is secured with the address 1GcuXgjPPyChs53Ka2kj2upAgRgpBdzcGY https://explorer.blockstack.org/address/1GcuXgjPPyChs53Ka2kj2upAgRgpBdzcGY
@Lucent
Lucent / rip-dvd-chapters.bat
Created July 31, 2018 03:58
Rip DVD into chapter/title files using VideoLAN
set DVDDrive=E:
set DestPrefix="Whatever"
set Title=2
set FirstChapter=1
set LastChapter=20
for /L %%i in (%FirstChapter%,1,%LastChapter%) do "vlc.exe" --sout "#standard{access=file,mux=ts,dst=%DestPrefix%_c%%i.mpg}" dvdsimple:///%DVDDrive%/#%Title%:%%i-%Title%:%%i vlc://quit
04dda9359cbbe5371631773b15ce7fb757293bf2c95002ab72733438b7d511148b64cca7979276450f4d834fff9743723a52339fa859229d339b128662cd58f514