Skip to content

Instantly share code, notes, and snippets.

View st235's full-sized avatar
🤖
Android SWE, Beep Boop Bop

Alex Dadukin st235

🤖
Android SWE, Beep Boop Bop
View GitHub Profile
@st235
st235 / openjdk-12-pi-3-guide.txt
Created September 8, 2019 20:23 — forked from NotAlexNoyle/openjdk-12-pi-3-guide.txt
A step-by-step tutorial on installing OpenJDK 12 on a Raspberry Pi 3 running Raspbian
Do you use your Raspberry Pi 3 to develop Java applications using OpenJDK? You may have noticed that the latest version available on the default apt repositories is OpenJDK 9. This is because the armhf architecture is underserved by the Oracle open source community. Luckilly, you can build and run the latest version (OpenJDK 12.x) on your device. It will just take some time, given the minimal power of the Pi 3's CPU.
The first step is to boot into raspbian and launch the shell.
Next, we are going to create 1GB of swap space for the build.
Get the 'pv' package:
> sudo apt-get install pv
@st235
st235 / gist:8924538c846c5d29b079666caf48a4de
Created September 12, 2018 15:03 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@st235
st235 / gh-pages-deploy.md
Created June 16, 2018 19:54 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@st235
st235 / on-jsx.markdown
Created June 7, 2018 21:16 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";
@st235
st235 / LongestCommonSubsequence.cs
Created November 19, 2017 14:01 — forked from riyadparvez/LongestCommonSubsequence.cs
Length of longest common subsequence in C#
private static int Max(int int1, int int2)
{
return int1 > int2 ? int1 : int2;
}
public static int LongestCommonSubsequence(string str1, string str2)
{
int [,] arr = new int [str1.Length+1, str2.Length+1];
for(int i=0; i<=str2.Length; i++)
@st235
st235 / remove_postgres_on_mac_os.md
Created October 1, 2017 10:16 — forked from Atlas7/remove_postgres_on_mac_os.md
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

This blog post has helped me clean up my postgres development environment on Mac. So making a copy!

How completely uninstall PostgreSQL 9.X on Mac OSX

This article is referenced from stackoverflow:

If installed PostgreSQL with homebrew , enter brew uninstall postgresql

If you used the EnterpriseDB installer , follow the following step.