Skip to content

Instantly share code, notes, and snippets.

View oboje's full-sized avatar
🎯
Focusing

Igor Popov oboje

🎯
Focusing
  • New York
View GitHub Profile
@oboje
oboje / claude_3.5_sonnet_artifacts.xml
Created September 4, 2024 19:15 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@oboje
oboje / FetchedResultsPublisher.swift
Created September 16, 2022 22:58 — forked from darrarski/FetchedResultsPublisher.swift
Swift-Combine-CoreData-Fetched-Results-Publisher
import Combine
import CoreData
public final class FetchedResultsPublisher
<ResultType>
: Publisher
where
ResultType: NSFetchRequestResult
{
@oboje
oboje / autopart.sh
Created August 10, 2021 11:11 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@oboje
oboje / chiastat
Created May 14, 2021 10:26 — forked from wallentx/chiastat
Dumping chia info to individual items to query via webserver endpoint
#!/usr/bin/env bash
source /home/your/path/to/chia-blockchain/activate
STR=$(chia farm summary | head -8)
FARM=$(chia farm summary | head -8 | sed 's/ /_/g; s/:_/=/g') #jq -Rs '{chia:split("\n")|map(split(": ")|{(.[0]):.[1]}?)}'
ACTIVE=$(pgrep -fa 'chia plots create' | wc -l)
printem() {
echo "Active_Plots=$ACTIVE"
@oboje
oboje / repo-rinse.sh
Created February 19, 2019 14:32 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@oboje
oboje / RAC_Samples.m
Created October 12, 2018 08:19 — forked from hsavit1/RAC_Samples.m
101 RAC Sample
//
// main.m
// 101RACSamples
//
// Created by Matthew Doig on 1/26/14.
// Copyright (c) 2014 DWI. All rights reserved.
//
#pragma mark Asynchronous operators
@oboje
oboje / sorting.hs
Created November 29, 2017 14:14 — forked from jason2506/sorting.hs
[Haskell Practice] some common sorting algorithms
import Data.List
bubbleSort :: (Ord a) => [a] -> [a]
bubbleSort [] = []
bubbleSort (first:[]) = first:[]
bubbleSort (first:remains) =
if first < smallest
then first:(bubbleSort bubbledRemains)
else smallest:(bubbleSort (first:(tail bubbledRemains)))
where bubbledRemains = bubbleSort remains
@oboje
oboje / UIVisualEffect.swift
Created January 21, 2017 12:26 — forked from ilyapuchka/UIVisualEffect.swift
(Ab)using UIVisualEffectView effect settings
extension UIVisualEffectView {
private var filterLayer: CALayer? {
return layer.sublayers?.first
}
private var blurFilter: NSObject? {
return filterLayer?
.filters?.flatMap({ $0 as? NSObject })
.first(where: { $0.value(forKey: "name") as? String == "gaussianBlur" })
@oboje
oboje / Xcode Theme : Obsidian Code
Last active December 23, 2021 14:15 — forked from jessedc/ObsidianCode.dvtcolortheme
Xcode Theme : Obsidian Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000