Skip to content

Instantly share code, notes, and snippets.

Avatar
🗑️
🔥

Michał Kałużny justMaku

🗑️
🔥
View GitHub Profile
View main.swift
import Foundation
import SystemConfiguration
enum Error: Swift.Error {
case pppInterfaceNotFound
case failedToWriteToConfigurationStore
}
let dynamicStore = SCDynamicStoreCreate(nil, "setVPNDNS" as CFString, nil, nil)
View dumpsystemconfiguration.py
#!/usr/bin/env python
#
# dump the contents of all toplevel keys in scutil's toplevel list.
#
import subprocess
import re
def run_command_with_input(command, input):
popen = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
@justMaku
justMaku / diff.txt
Created Sep 16, 2019
Seed 1 vs Seed 2
View diff.txt
Files s1/Contents/Applications/Create ML.app/Contents/MacOS/Create ML and s2/Contents/Applications/Create ML.app/Contents/MacOS/Create ML differ
Files s1/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/DTBinaryAnalysis and s2/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/DTBinaryAnalysis differ
Files s1/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/Versions/A/DTBinaryAnalysis and s2/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/Versions/A/DTBinaryAnalysis differ
Files s1/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/Versions/Current/DTBinaryAnalysis and s2/Contents/Applications/Instruments.app/Contents/Frameworks/DTBinaryAnalysis.framework/Versions/Current/DTBinaryAnalysis differ
Files s1/Contents/Applications/Instruments.app/Contents/Frameworks/DTInstrumentsX.framework/DTInstrumentsX and s2/Contents/Applications/Instru
View gist:6fe259e7fdf847c1a83cbf7da1f42675
[0] Eastern Kingdoms = 868
[1] Kalimdor = 1015
[13] Art Team Map = 0
[25] Scott Test = 0
[30] Alterac Valley = 35
[33] Shadowfang Keep = 0
[34] Stormwind Stockade = 0
[35] <unused>StormwindPrison = 0
[36] Deadmines = 0
[37] Azshara Crater = 0
View stitcher.rb
require 'net/http'
require 'uri'
require 'json'
require 'cgi'
def lcs(a, b)
lengths = Array.new(a.length) { Array.new(b.length, 0) }
greatest_length = 0
output = ''
a.each_char.with_index do |x, i|
View dumper.rb
require 'net/http'
require 'uri'
require 'json'
require 'cgi'
@mutex = Mutex.new
def query(query)
uri = URI.parse("https://www.amazon.de/gp/search-inside/service-data")
http = Net::HTTP.new(uri.host, uri.port)
View Authenticator.swift
import RxSwift
import Heimdallr
class Authenticator {
static let tokenURL = NSURL(string: "http://localhost:3000/oauth/token")
let oauthProvider: Heimdallr
init() {
let credentials = OAuthClientCredentials(id: "", secret: "")
View gist:fa813c5b879efa26803188843c35cbf9
Danger::CISource::Buildkite
validates when buildkite env var is found
doesnt validate when buildkite is not found
gets out a repo slug from a git+ssh repo and pull request number
gets out a repo slug from a https repo and pull request number
Danger::CircleAPI
has a nil token as default
sets the token on initialize
creates a client with the correct base url
View output.log
=== BUILD AGGREGATE TARGET add_custom_command_target-9277a59e76526c1f3369c9ca8ff73903-UnicodeExtendedGraphemeClusters.cpp OF PROJECT Swift WITH CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
write-file /Users/maku/Projects/OpenSource/swift-os/build/Xcode-DebugAssert/swift-macosx-x86_64/lib/Basic/Swift.build/Debug/add_custom_command_target-9277a59e76526c1f3369c9ca8ff73903-UnicodeExtendedGraphemeClusters.cpp.build/Script-A3AAFACAEAC54F0680167E45.sh
chmod 0755 /Users/maku/Projects/OpenSource/swift-os/build/Xcode-DebugAssert/swift-macosx-x86_64/lib/Basic/Swift.build/Debug/add_custom_command_target-9277a59e76526c1f3369c9ca8ff73903-UnicodeExtendedGraphemeClusters.cpp.build/Script-A3AAFACAEAC54F0680167E45.sh
PhaseScriptExecution CMake\ Rules /Users/maku/Projects/OpenSource/swift-os/build/Xcode-DebugAssert/swift-macosx-x86_64/lib/Basic/Swift.build/Debug/add_custom_command_target-9277a59e76526c1f3369c9ca8ff73903-UnicodeExtendedGraphemeClusters.cpp.build/Script-A3AAFACAEAC54F0680167E45.sh
cd /Us
You can’t perform that action at this time.