Skip to content

Instantly share code, notes, and snippets.

class Parallel < Formula
desc "Shell command parallelization utility"
homepage "https://savannah.gnu.org/projects/parallel/"
url "https://ftp.gnu.org/gnu/parallel/parallel-20191122.tar.bz2"
mirror "https://ftpmirror.gnu.org/parallel/parallel-20191122.tar.bz2"
sha256 "182a93155dea12ddc36b7e85fd2d8342d7a88e7a449e4161a5a291e1f4989507"
head "https://git.savannah.gnu.org/git/parallel.git"
bottle do
cellar :any_skip_relocation
@dreadjr
dreadjr / analyse_watchers.js
Created March 25, 2019 20:21 — forked from DTFagus/analyse_watchers.js
Bookmarklet to analyse angular watchers
javascript: (function() {
var root = $(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];
@dreadjr
dreadjr / jq-insert-var.sh
Created January 4, 2019 22:45 — forked from joar/jq-insert-var.sh
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@dreadjr
dreadjr / RNMultipleTargetsInstructions.md
Created November 20, 2018 23:35 — forked from jacks205/RNMultipleTargetsInstructions.md
Settings up multiple app targets in React-Native
@dreadjr
dreadjr / react-native-deployments.md
Created November 20, 2018 21:59 — forked from ptgamr/react-native-deployments.md
Environment configurations for React Native App

Intro

If you ever need a mobile application, you probably have an API endpoint to talk to. And if you're doing it right, you should have different environment for your API, usually it'll be: dev, staging, production.

The problem: How do we do the testing for our app?

We dont' want to perform test againts the production API. We need a way to teach our app to talk to different API environment. But what is the switch?

The naive way:

@dreadjr
dreadjr / registry-images.sh
Created September 5, 2018 16:06 — forked from adampats/registry-images.sh
Docker Registry v2 API list images and tags
# Assumes htpass authentication
registry_server='docker.mycloud.com'
username='bob'
# List all images (i.e. repositories)
curl -k -X GET "https://$registry_server/v2/_catalog" -u $username -H "Accept: application/json"
Enter host password for user 'bob':
{"repositories":["app-base","ubuntu","cache-base"]}
curl "YOUR_WEBHOOK" -d '{"text":"https://twitter.com/cdixon/status/591658510007410688"}'
@dreadjr
dreadjr / generate-pushid.js
Created May 11, 2018 16:58 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@dreadjr
dreadjr / app.js
Created May 3, 2018 22:34 — forked from ajl100b/app.js
Redirect to search results component upon submit of search terms from search bar embedded in a global navbar
import React, { Component } from 'react'
import { Redirect } from 'react-router'
export default class Search extends Component {
constructor () {
super();
this.state = {
fireRedirect: false
}
}

Keybase proof

I hereby claim:

  • I am dreadjr on github.
  • I am dreadjr (https://keybase.io/dreadjr) on keybase.
  • I have a public key ASCt5wHulzvZaA6UDZz7Q56ETYctFcUPsrmbQ0JHWWGIVQo

To claim this, I am signing this object: