Skip to content

Instantly share code, notes, and snippets.

View vi4m's full-sized avatar
:atom:
coding

✪ vi4m Marcin Kliks vi4m

:atom:
coding
View GitHub Profile
@vi4m
vi4m / why_i_stopped_answering_questions.md
Last active July 5, 2024 12:55
Why I stopped answering half of the questions

Why I Stopped Answering Most Questions

Recently, I started rejecting general questions. General questions are often wrong. Yes, you can ask wrong questions, and it's worse than giving bad answers.

It's especially evident today with questions about AI's future, the future of jobs, or other simplistic questions. Wrong questions lead to harmful actions and consequences.

For example, people often ask, "Will AI take my job?" Answering "yes" can lead to negative outcomes. Another bad question might be, "Are immigrants bad?" While some might be, asking such questions is harmful.

So, how to ask good questions? The more you know about a topic, the better the questions you can ask. No wonder the answer to the Ultimate Question of Life, the Universe, and Everything is 42; the question itself is crucial.

import TokamakShim
import JavaScriptKit
public let window = JSObject.global.window.object!
public let location = JSObject.global.location.object!
struct TokamakApp: App {
var body: some Scene {
WindowGroup("Tokamak App") {
ContentView()
@vi4m
vi4m / keybase.md
Created January 29, 2018 15:13
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am vi4m on github.
* I am vi4m (https://keybase.io/vi4m) on keybase.
* I have a public key ASCLCcLhtEgffh8mDXgJ86Q_kyPP6wppprdI_MK1madJdwo
To claim this, I am signing this object:
@vi4m
vi4m / asciiwwdc.com
Created December 31, 2016 20:09
single page macos swift app webview wrap of http://asciiwwdc.com
#!/usr/bin/swift -target x86_64-apple-macosx10.12 -v
import Cocoa
import WebKit
func halfWindow(title: String = "Half Window (^c to quit)") -> NSWindow {
let window = NSWindow()
if let screen = window.screen {
var frame = screen.visibleFrame
let size = CGSize(width: frame.size.width / 2, height: frame.size.height)
frame = CGRect(origin: .zero, size: size)
@vi4m
vi4m / request.txt
Created September 17, 2016 20:26
zewo bug - request.txt
HTTP/1.1 200 OK
Date: Fri, 16 Sep 2016 16:23:17 GMT
Connection: close
test
@vi4m
vi4m / zewo.py
Created September 17, 2016 20:25
zewo bug - server.py
#!/usr/bin/env python
"""
Demo Content-Length bug in Zewo
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@vi4m
vi4m / fixer.swift
Last active September 14, 2016 08:30
XCode 7 fix for zewo packages
#!/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a.xctoolchain/usr/bin/swift
import Foundation
func currentPath() -> String {
let pathPointer = UnsafeMutablePointer<Int8>(allocatingCapacity: 1024)
defer { pathPointer.deallocateCapacity(1024) }
@vi4m
vi4m / struct_and_inheritance.swift
Created December 28, 2015 12:46 — forked from AliSoftware/struct_vs_inheritance.swift
Swift-Struct-Inheritance
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/

Write simple Singleton.

Write Singleton which returns the same object every time. You can use the implementation you want.

first_object = Singleton(name='test1')
second_object = Singleton(name='test2')
print(first_object.name == second_object.name)