Skip to content

Instantly share code, notes, and snippets.

@acfoltzer
acfoltzer / HOWTO.md
Last active October 6, 2020 11:54
Change git init's default branch name

Change the name of the default branch created by git init

Suppose you want the default branch name created by git init (or tools that shell out to it, like cargo new) to be something other than master. In this example, I'll call it develop.

  1. Add the following to your .gitconfig:

    [init]
        templateDir = ~/.config/git/template/
    
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@kritzcreek
kritzcreek / Kinds-and-do-syntax.md
Last active March 28, 2020 11:51
Kinds and Do-Syntax

Kinds

In PureScript there are types of different kinds. Kinds are types for types. For example Int has kind Type, and we write it as Int :: Type. You can ask for the kind of a type in purs psci

> :k Int
Type

Type constructors take types to other types. For example Array (which still needs another type to form a type a value could have, like Array Int):

#!/usr/bin/env stack
{-
stack
--resolver lts-8.4
--install-ghc
runghc
--package aeson
--package aeson-casing
--package base
--package bytestring

#Layout Component:

Internal Layout Styles:

Internal styles are styles that are applied to a component to style all its inner (immediate) children from border inward. The goal of this is to keep components as dynamic as possible by only defining what itself should always look like. We don't worry about where it is on the page or how is should look along side other components.

Internal layout styles include:

  • alignContent
@dgonzo
dgonzo / LEAP.md
Last active July 8, 2016 04:15
LEAP Specification vAlpha

LEAP Specification version Alpha

LEAP is a specification for creating common-sense APIs for integrating advanced analytic* services around four basic processes; Label, Explore, Analyze, Predict (LEAP) that are HTTP-based and that conform to most or all of the principles of REST.

  • (e.g. machine learning, artificial intelligence, and visualization)

By following these conventions you will hopefully avoid confusion, increase adoption, become more productive, and be able to focus on what matters most: making full use of your data and other sources to make your applications and services smarter.

Services built around LEAP compliant specifications will surface APIs that are highly intuitive and they will provide clients with standard RESTful interfaces over HTTP.

Redux Chaos Monkey

This is a proof of concept which allows you to replay system events in a random order each time to make sure your UI can tolerate variable states.

I'm not sure if this is worthy of its on open source project with additional features like changing play back time, whitelisting/blacklisting actions etc but figured I'd put this out there to see if it piques anyones interest.

See a video of this in action here: [https://www.youtube.com/watch?v=wkoukONfwmA](Video on YouTube).

@sgnn7
sgnn7 / enable_mongo.sh
Created December 22, 2015 23:06
Mongodb 3.2 on Ubuntu 15.10
echo '[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
[Install]
@jamiebuilds
jamiebuilds / gulpfile.js
Created October 5, 2015 20:45
Example multi-file gulp setup
export lint from './task-lint';
export test from './task-test';
export build from './task-build';
export dev from './task-dev';
export default dev;
@quephird
quephird / Pi.purs
Last active September 3, 2015 22:39
Solution to exercise in PureScript by Example book to estimate pi
module Pi where
import Control.Monad.Eff (Eff(..), forE)
import Control.Monad.Eff.Random (RANDOM(..), random)
import Control.Monad.ST (ST(..), modifySTRef, newSTRef, readSTRef)
import Data.Array ((:), filter, length)
import Data.Int (toNumber)
import Data.Tuple (Tuple(..))
import Prelude (($), (<=), (+), (*), (/), bind, return, unit)