This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JIT session error: Symbols not found: [ _OBJC_CLASS_$_NSWorkspace, _NSWorkspaceDidWakeNotification ] | |
Failed to materialize symbols: { (main, { __swift_FORCE_LOAD_$_swiftObjectiveC_$_watch_for_lock_unlock, _got.$sSY8rawValuexSg03RawB0Qz_tcfCTq, _$sSo18NSNotificationNameaSYSCMA, __swift_FORCE_LOAD_$_swiftos_$_watch_for_lock_unlock, _got.$s8RawValueSYTl, _got.$ss20_SwiftNewtypeWrapperPSYTb, _$s10Foundation12NotificationVIeghn_So14NSNotificationCIeyBhy_TR, _symbolic _____ 21watch_for_lock_unlock18ScreenLockObserverC, _got.$ss20_SwiftNewtypeWrapperMp, _$s21watch_for_lock_unlock18ScreenLockObserverCMn, _$sSo18NSNotificationNameaABSYSCWL, _$s21watch_for_lock_unlock18ScreenLockObserverCMm, _got.$s15_ObjectiveCTypes01_A11CBridgeablePTl, _associated conformance So18NSNotificationNameaSHSCSQ, _associated conformance So18NSNotificationNameas20_SwiftNewtypeWrapperSCSY, _$sSo18NSNotificationNameaABs35_HasCustomAnyHashableRepresentationSCWl, _$sSo18NSNotificationNameas20_SwiftNewtypeWrapperSCMc, _$sS2Ss21_ObjectiveCBridgeab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.server | |
import socketserver | |
from http import HTTPStatus | |
import os | |
class Handler(http.server.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(HTTPStatus.OK) | |
self.end_headers() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if ! [ $# -eq 1 ] ;then | |
echo "Ha mappen du vil ha backup av som argument" | |
exit 1 | |
fi | |
echo "Navn på backupen:" | |
read name | |
echo "Passord:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fullURL(r *http.Request, overridePath ...string) string { | |
scheme := "http" | |
if r.TLS != nil { | |
scheme = "https" | |
} | |
if len(overridePath) != 0 { | |
return fmt.Sprintf("%s://%s%s", scheme, r.Host, overridePath[0]) | |
} | |
return fmt.Sprintf("%s://%s%s?%s#%s", scheme, r.Host, r.URL.Path, r.URL.RawQuery, r.URL.Fragment) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://github.com/isfonzar/filecrypt/blob/master/filecrypt.go | |
func encryptAES(password, plaintext string) (string, error) { | |
key := []byte(password) | |
nonce := make([]byte, 12) | |
// Randomizing the nonce | |
if _, err := io.ReadFull(rand.Reader, nonce); err != nil { | |
return "", fmt.Errorf("io.ReadFull(...): %w)", err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const url = require('url'); | |
function handler(req, res) { | |
res.writeHead(200, {'Content-type':'text/plain'}); | |
res.write('Hello, I am a webserver !'); | |
res.end(); | |
} | |
const port = process.env.PORT || 8080; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/blendle/zapdriver" | |
"go.uber.org/zap" | |
) | |
func main() { | |
structuredLogger, _ := zapdriver.NewProduction() | |
defer structuredLogger.Sync() // flushes buffer, if any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.heic; do sips -s format jpeg "$file" --out "${file%.heic}.jpg" && rm -f "$file"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
click menu item "Archive" of menu "Message" of menu bar 1 of application process "Mail" | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filetype plugin indent on | |
syntax on | |
au FileType gitcommit set tw=72 | |
" scrolling in (iTerm2) | |
:set mouse=a | |
" Spellchecking in vim | |
:setlocal spell spelllang=en_us |
NewerOlder