Skip to content

Instantly share code, notes, and snippets.

@Microtribute
Microtribute / US_State_Bounding_Boxes.csv
Created January 19, 2022 10:07 — forked from a8dx/US_State_Bounding_Boxes.csv
Bounding boxes for all US states and territories [NAD83]
STATEFP STUSPS NAME xmin ymin xmax ymax
1 01 AL Alabama -88.473227 30.223334 -84.88908 35.008028
2 02 AK Alaska -179.148909 51.214183 179.77847 71.365162
3 60 AS American Samoa -171.089874 -14.548699 -168.1433 -11.046934
4 04 AZ Arizona -114.81651 31.332177 -109.045223 37.00426
5 05 AR Arkansas -94.617919 33.004106 -89.644395 36.4996
6 06 CA California -124.409591 32.534156 -114.131211 42.009518
7 08 CO Colorado -109.060253 36.992426 -102.041524 41.003444
8 69 MP Commonwealth of the Northern Mariana Islands 144.886331 14.110472 146.064818 20.553802
9 09 CT Connecticut -73.727775 40.980144 -71.786994 42.050587
[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
acks :: [[Int]]
acks = [ [ case (m, n) of
(0, _) -> n + 1
(_, 0) -> acks !! (m - 1) !! 1
(_, _) -> acks !! (m - 1) !! (acks !! m !! (n - 1))
| n <- [0..] ]
| m <- [0..] ]
main :: IO ()
main = print $ acks !! 4 !! 1
@Microtribute
Microtribute / Random-string
Created March 10, 2021 15:30 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
-- Extensible Records
-- given a record
x = { age = 42, name = "Boke" }
-- you can clone and remove a field in the process
{ x - age } -- { name = "Boke" }
-- you can also add a field
{ x | species = "Jade Dragon" } -- { age = 42, name = "Boke", species = "Jade Dragon" }
@Microtribute
Microtribute / ConstructorMapper.php
Created October 28, 2020 06:11 — forked from boekkooi/ConstructorMapper.php
Symfony Form DataMapper using object constructors
<?php
namespace Acme\Symfony\Form\DataMapper;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
class ConstructorMapper extends PropertyPathMapper
{
@Microtribute
Microtribute / Main.elm
Created October 12, 2020 19:11 — forked from pablohirafuji/Main.elm
Elm simple form example
module Main exposing (..)
import Http
import Task
import Html.App as Html
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Form exposing (Form)
import Form.Validate as Validate exposing (..)
@Microtribute
Microtribute / checkIsBrave.js
Created September 9, 2020 15:03 — forked from drbh/checkIsBrave.js
Reliably detect Brave Browser with native JS
// helper to find Brave in User Agent string
function isBraveAgent(userAgentResponse) {
var isBraveIndex = ~userAgentResponse.indexOf('Brave')
if (isBraveIndex < 0) {
return true
}
return false
}
// Function from Javarome
@Microtribute
Microtribute / Math.php
Created September 4, 2020 15:32 — forked from jgrossi/Math.php
Math class from Taylor Otwell. Thanks to @brad (captain_jim1@yahoo.com) for the class content.
<?php
class Math {
/**
* The base.
*
* @var string
*/
private static $base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
@Microtribute
Microtribute / CountryRepository.php
Created September 1, 2020 17:30 — forked from adamsafr/CountryRepository.php
Doctrine: Union with JOIN example
<?php
namespace AppBundle\Repository;
use AppBundle\Entity\Country;
use AppBundle\Entity\CountryTranslation;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\QueryBuilder;