Skip to content

Instantly share code, notes, and snippets.

View odrobnik's full-sized avatar

Oliver Drobnik odrobnik

View GitHub Profile
@odrobnik
odrobnik / 350_prisoners_translated.csv
Last active December 1, 2023 15:03
Converted the HTML from https://www.gov.il resolution 1077 into CSV and translated everything as good as possible from Hebrew to English.
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 20 columns, instead of 9. in line 4.
Prisoner Name,Hometown,Released,Prisoner Number,Identity Card,Gender,Age,Date of Birth,Residence Area,Organizational Affiliation,Type of ID,Israeli Citizenship,Type of Prisoner,Date of Arrest,Age at Arrest,Incarceration Period (Years—Months--Days),Details of Offenses,Court,Plea File Number,Court File Number
Ahdab Mohammed Ali Hourani,’48 Lands,11/30/2023,1399758,31479520,Female,45,10/24/1978,Green Line,None,Blue,Yes,Detainee,10/23/2023,44,In Detention,Support for Terrorism,Civil Court,464978/2023,23-11-3383 
Aseel Abdel Wahab Kamel Ibrahim,’48 Lands,11/30/2023,9213175,206547572,Female,25,08/12/1998,Green Line,None,Blue,Yes,Detainee,11/13/2023,25,In Detention,Support for Terrorism,Civil Court,492628/23,46537-11-23
Aseel Hussein Mahmoud Sweitat,’48 Lands,11/30/2023,9213089,209050970,Female,25,07/12/1998,Green Line,None,Blue,Yes,Detainee,11/12/2023,25,In Detention,Support for Terrorism,Civil Court,495573/2023,41261-11-23
Ayat Saeed Qasim Atamleh,’48 Lands,11/30/2023,9213066,206613929,Female,25,06/12/1998,Green L
@odrobnik
odrobnik / prisoners.json
Last active November 26, 2023 22:14
JSON Version of the List of Palestinian prisoners slated for potential release
[
{
"nameHebrew" : "אבאאהים אחמד בדר זמאערה",
"duration" : "In Detention",
"type" : "Detainee",
"dateOfBirth" : "30.1.2005",
"name" : "Abaha'im Ahmad Badr Zama'ara",
"number" : "9189454",
"gender" : "Male",
"city" : "Judea and Samaria Area",
@odrobnik
odrobnik / gist:e8ac59e13b62ea80b623
Created January 11, 2016 11:26
Calling AppleScript from Swift App, passing a parameter
// Swift version of https://developer.apple.com/library/mac/technotes/tn2084/_index.html
@IBAction func testButtonPushed(sender: AnyObject) {
let URL = NSBundle.mainBundle().URLForResource("SendFinderMessage", withExtension: "scpt")!
var errors: NSDictionary?
let script = NSAppleScript(contentsOfURL: URL, error: &errors)!
@odrobnik
odrobnik / yMunch.swift
Created February 8, 2023 21:33
Command Line utility to convert Yahoo Finance CSV export into markdown table for ChatGPT
import SwiftCSV
import Foundation
extension Double {
/// Rounds the double to decimal places value
func rounded(toPlaces places:Int) -> Double {
let divisor = pow(10.0, Double(places))
return (self * divisor).rounded() / divisor
}
}
//
// RankingsView.swift
// ChessClub
//
// Created by Oliver Drobnik on 22.04.22.
//
import SwiftUI
struct RankingsView: View
@odrobnik
odrobnik / NavPicker.swift
Last active June 16, 2023 01:03
Trying to emulate Picker behaviour inside a List
//
// NavPicker.swift
// ColorCore Demo
//
// Created by Oliver Drobnik on 09.02.21.
//
import SwiftUI
public struct NavPicker<Label, Items> : View where Label : View, Items: CustomStringConvertible & Identifiable
POST https://api.openai.com/v1/chat/completions
{
"functions" : [
{
"name" : "date",
"description" : "Get the current date and time",
"parameters" : {
"type" : "object",
"properties" : {
@odrobnik
odrobnik / gpt4_problems.markdown
Last active June 15, 2023 23:29
GPT4 Problem Solving with functions

I've provided these functions:

  • date()
  • dateDiff(date1, date2)
  • birthday(user)

Oliver

"Let's think this through step by step and please list each step and give your thinking.

@odrobnik
odrobnik / gist:4086204
Created November 16, 2012 10:20
Forwarding keydown event to a search field
- (void)goToProductListWithEvent:(NSEvent *)event
{
self.selectedViewController = _productListViewController;
// make the search bar first responder
NSWindow *window = self.view.window;
[window makeFirstResponder:_productListViewController.searchField];
// set the keyDown character into the search field
_productListViewController.searchField.stringValue = [event characters];
func unitSquareIntersectionPoint(_ angle: Angle) -> UnitPoint {
let normalizedDegree = angle.degrees.truncatingRemainder(dividingBy: 360)
let degreeProportion = (normalizedDegree / 90).truncatingRemainder(dividingBy: 4)
switch degreeProportion {
case 0: return UnitPoint(x: 1.0, y: 1.0)
case 1: return UnitPoint(x: 1.0, y: 1.0 - (normalizedDegree - 270) / 90)
case 2: return UnitPoint(x: 1.0 - (normalizedDegree - 180) / 90, y: 0.0)
case 3: return UnitPoint(x: 0.0, y: (normalizedDegree - 90) / 90)
default: return .zero