Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Bandukwala 7h3kk1d

View GitHub Profile
@7h3kk1d
7h3kk1d / echo.java
Created Nov 1, 2021
An example of an algorithm being parametric in it's monad to be used with or without IO
View echo.java
package com.thekkid.ninetyninelambdas.problems;
import com.jnape.palatable.lambda.adt.Unit;
import com.jnape.palatable.lambda.functions.builtin.fn2.ToCollection;
import com.jnape.palatable.lambda.functor.builtin.State;
import com.jnape.palatable.lambda.io.IO;
import com.jnape.palatable.lambda.monad.MonadRec;
import java.util.ArrayList;
import java.util.Collections;
View bool
public abstract class Bool extends Number implements CoProduct2<Bool.False, Bool.True, Bool> {
@Override
public byte byteValue() {
return match(constantly((byte) 0),
constantly((byte) 1));
}
@Override
public short shortValue() {
return byteValue();
View Noncoherence.hs
Prelude> [\x -> x + 1, \x -> x -1] <*> [1,2]
[2,3,0,1]
Prelude> [1,2] >>= \y -> [y+1, y-1]
[2,0,3,1]
View gist:9d8618bdc675803b4cf567a0fa249a00
import random
while True:
a = [random.randint(1, 6), random.randint(1, 6), random.randint(1, 6), random.randint(1, 6)]
print(a)
if len(set(a)) == 1:
break
@7h3kk1d
7h3kk1d / humble_bundle_file_downloader.js
Created Feb 25, 2018 — forked from tlc/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
View humble_bundle_file_downloader.js
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
View keybase.md

Keybase proof

I hereby claim:

  • I am 7h3kk1d on github.
  • I am abanduk (https://keybase.io/abanduk) on keybase.
  • I have a public key whose fingerprint is E989 E899 2A5D 1100 8C31 7ED4 E464 5514 8FC6 DE3D

To claim this, I am signing this object:

View gist:712151e4a27e42e6abc6
{
"name": "template_name",
"content": {
"name" : {"first" : "first", "last":"last"},
"users" : ["user1","user2","user3"],
"address" : "100 first st."
}
}
View gist:cda429a27528a4b285f0
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
// add tests
suite.add('Calling cow api', {
defer: true,
fn: function(deferred) {
deferred.resolve();
}
View gist:5540a96eed7cca0f15b0
Aug 6 18:49:57 alexander-Latitude-E6430 pptp[28743]: nm-pptp-service-28723 log[logecho:pptp_ctrl.c:677]: Echo Reply received.
Aug 6 18:50:15 alexander-Latitude-E6430 wpa_supplicant[1653]: wlan0: CTRL-EVENT-SCAN-STARTED
Aug 6 18:50:20 alexander-Latitude-E6430 wpa_supplicant[1653]: nl80211: send_and_recv->nl_recvmsgs failed: -33
Aug 6 18:52:02 alexander-Latitude-E6430 pppd[28724]: No response to 5 echo-requests
Aug 6 18:52:02 alexander-Latitude-E6430 pppd[28724]: Serial link appears to be disconnected.
Aug 6 18:52:02 alexander-Latitude-E6430 pppd[28724]: Connect time 3.5 minutes.
Aug 6 18:52:02 alexander-Latitude-E6430 pppd[28724]: Sent 104722 bytes, received 8096 bytes.
Aug 6 18:52:02 alexander-Latitude-E6430 pppd[28724]: MPPE disabled
Aug 6 18:52:05 alexander-Latitude-E6430 pppd[28724]: Connection terminated.
View gist:d49521ae251a46da31e2
EMAIL_UST_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'username@domain.com'
EMAIL_HOST_PASSWORD = 'password'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER