This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A logarithmic string length algorithm in the TypeScript type system utilizing | |
* a memoizing recursive type. Computes the length of any string with far | |
* superior performance than any other current implementations via a doubling | |
* cache and string patterns backing the checks. Works for any string with less | |
* than 10,000 characters due to the tuple size limits for the cache (in total). | |
* | |
* @author Carter Snook <[email protected]> github.com/sno2 | |
* @license https://unlicense.org/ (credit would be nice tho) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This first file contains the first iteration of this pattern. It's already | |
// nice, but not enough for full-fledged IoC libraries. | |
// There's a second file in this same gist that goes one step further, although, | |
// for now, it still needs some extra polish. | |
// ----------------------------------------------------------------------------- | |
// First: the two main interfaces. | |
// They are the core of the pattern. | |
// ----------------------------------------------------------------------------- | |
export interface WritableRegistry { |
I hereby claim:
- I am castarco on github.
- I am castarco (https://keybase.io/castarco) on keybase.
- I have a public key whose fingerprint is 9D10 B5B4 1B15 934F C867 8397 40BB CA62 EF4B 86CC
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
function array_zip(array ...$arrays): array | |
{ | |
// Applied suggestion from reddit | |
// https://www.reddit.com/r/PHP/comments/76czco/php_equivalent_of_pythons_zip_function/doe5j86/ | |
return \array_map(null, ...$arrays); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
######################################################################################################################## | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2016 Andrés Correa Casablanca | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Andrés Correa Casablanca <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.io.IOException; | |
import java.lang.Process; | |
import java.lang.Runtime; | |
import java.util.HashMap; | |
/** | |
* SystemStatusReader is a collection of methods to read system status (cpu and memory) | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package prop.g12.common; | |
import java.util.*; | |
/** | |
* This class represents non-directed weighted graphs without edges connecting nodes with themselves. The weights must | |
* be in the [0,1] interval, since they represent affinities between nodes in a normalized scale. | |
* | |
* This class is optimized for read operations, rather than write operations. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package prop.g12.common; | |
import com.google.common.collect.Sets; | |
import java.util.*; | |
/** | |
* This class encapsulates the Clique Percolation algorithm, used to detect overlapped communities inside non-directed | |
* and not weighted graphs. |
NewerOlder