Skip to content

Instantly share code, notes, and snippets.

View BlakeBarrett's full-sized avatar
😎
Working from home

Blake Barrett BlakeBarrett

😎
Working from home
View GitHub Profile
@BlakeBarrett
BlakeBarrett / FileDropModifierExtensions.kt
Created January 6, 2024 02:06
How to handle files dropped into a KMP/KMM Compose Desktop project. Tested on Win/macOS/Linux.
/*
* BSD 3-Clause License
*
* Copyright (c) 2023, Blake Barrett
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
@BlakeBarrett
BlakeBarrett / 20-users-info-sample.json
Created August 21, 2023 00:42
JSON USER DATA EXAMPLE: Fake Users JSON array generated by ChatGPT
[
{
"id": 1,
"first_name": "Alice",
"last_name": "Smith",
"email": "alice@example.com",
"age": 28,
"last_login_date": "2023-08-09T10:30:00",
"friends_user_ids": [2, 3, 5, 7],
"favorite_animal": "Dog",
@BlakeBarrett
BlakeBarrett / Things to learn when approaching a new programming language or framework
Last active June 14, 2021 21:58
Learning a New (Programming) Language Checklist
* What are the files named?
* What casing is convention?
* Semi-colons or not?
* What does the code look like, conventionally?
* Programming in general:
variables, constants, static, structs, interfaces, enums, lists (arrays, maps) classes, abstract, anonymous classes, functions, closures, async, threads, network io, (de)serialization, files, streams, graphics, local hardware, etc...
unit testing
* UI:
What are "screens" called?
Views, containers, text, images, buttons, text input, "component" input i.e. sliders, radios, check boxes, etc,
@BlakeBarrett
BlakeBarrett / Pandora ACE-Team Interview Question.md
Created March 31, 2017 00:00
Pandora ACE Team, Objective-C/Swift Interview Question.

At Pandora all of our legacy iOS code is written in Objective-C (using ARC), however all new classes/features/work will be written in Swift. In this scenario, you are refactoring a legacy Objective-C file to be more readable. There is a function createSoftButtonWithIdentifier. It takes three arguments: identifier, text and iconValue -- all of which will only ever be used together {id:@1, text: @"List", iconValue: @"list_icon"} -- there are no circumstances under which the arguments will be mixed up.

- (SoftButton *) createSoftButtonWithIdentifier:(NSNumber *)identifier
@BlakeBarrett
BlakeBarrett / gist:6f85c911af3d6798310e
Created December 2, 2014 18:50
Java / JSON Interview Question
// Find as many errors as possible with this method
/**
* Is the specified user an admin?
*/
public Boolean isUserAdmin(final JSONObject userJson) {
final String userType = userJson.getString("user_type");
if (userType.equals("admin")) {
return true;
} else {
@BlakeBarrett
BlakeBarrett / gist:5687657
Created May 31, 2013 20:14
A bare-minimum sample for performing a GET request on a REST endpoint.
$.getJSON(myRESTRequestUrl).complete(function(data){
callNextFunction(data);
});