Skip to content

Instantly share code, notes, and snippets.

View blaketarter's full-sized avatar
🌃

Blake Tarter blaketarter

🌃
View GitHub Profile
@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active February 6, 2024 21:29
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@alphamu
alphamu / Android Privacy Policy Template
Created February 9, 2017 03:17
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described

A Better ListView for React Native

I have a proposal for some new APIs, and a first draft on an implementation (first diff: D4412469). Salient points on the new APIs:

  • Two easy-to-use components: FlatList and SectionList. I have found that separating the section API out makes things a lot cleaner for both cases.

  • One shared underlying implementation, VirtualizedList, which has an API similar to react-virtualized and uses getter functions to be very flexible and supports any kind of data structure such as a plain array or an immutable list.

  • Naming adjustments to make it horizontal agnostic, e.g. "Item" instead of "Row".

@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@gre
gre / AutoCaptureGLThing.js
Last active August 23, 2017 10:42
example that render things offscreen with gl-react – would love if you find a way to make this use-case less hacky
class AutoCaptureGLThing extends Component {
onRef = exportable => {
if (!exportable || this.exporting) return;
this.exporting = true;
exportable.captureFrame(/* see https://projectseptemberinc.gitbooks.io/gl-react/content/docs/api/Surface.html */)
.then(path => { // oops back to node callback pattern via props callback
this.props.onCapture(null, path);
}, error => {
this.props.onCapture(error);
});
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@marcqualie
marcqualie / backup-mysql
Last active April 20, 2016 14:25
Simple scripts to backup MySQL and Web Content
#!/usr/bin/env python
import os
import time
# Variables
username = 'backup'
password = 'password'
hostname = 'localhost'
filestamp = time.strftime('%Y%m%d')
@eligrey
eligrey / leaks.md
Last active November 22, 2023 23:14
Entities that have sold or leaked my personal data

Eli's leak list

The following entities have either sold or leaked personal data about me, including email addresses and phone numbers. Be wary of sharing your data with them.

Email addresses

These entities have either sold or leaked specific unique email addresses of mine to unauthorized parties, such as spammers.