Skip to content

Instantly share code, notes, and snippets.

View oelna's full-sized avatar
😔
The light inside has broken, but I still work

Arno Richter oelna

😔
The light inside has broken, but I still work
View GitHub Profile
@PetrusM
PetrusM / AVMetadataMachineReadableCodeObject+Binary.swift
Created October 25, 2022 06:31
AVKit : Get binary data from QRCode
import Foundation
import AVKit
// This extension is based upon https://www.thonky.com/qr-code-tutorial/data-encoding
extension AVMetadataMachineReadableCodeObject
{
var binaryValue: Data?
{
switch type
{
@marcoarment
marcoarment / S3.php
Last active June 25, 2023 19:41
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@oelna
oelna / shortcuts.js
Last active April 10, 2022 15:06
Quick $ and $$ wrappers for querySelector
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
@LeaVerou
LeaVerou / settings.json
Created August 3, 2021 11:24
VS Code Solarized Light that looks like Atom’s Solarized Light (WIP)
{
"workbench.colorTheme": "Solarized Light",
"editor.fontFamily": "Consolas, Menlo, Monaco, 'Courier New', monospace",
"editor.insertSpaces": false,
"editor.inlineSuggest.enabled": true,
"editor.fontSize": 14.5,
"editor.renderWhitespace": "boundary",
"editor.codeLens": false,
"editor.inlayHints.fontFamily": "Consolas, Menlo, Monaco, 'Courier New', monospace",
"diffEditor.codeLens": true,
@mholt
mholt / keypairs.js
Created June 25, 2021 20:07
Generate key pairs and PEM-encode them using vanilla JS and browser Crypto API
//
// Convert an ArrayBuffer into a string.
// From https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String
function arrayBufToString(buf) {
return String.fromCharCode.apply(null, new Uint8Array(buf));
}
function pemEncode(label, data) {
const base64encoded = window.btoa(data);
/*! QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License
Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";function t(t,e){var n;return"function"==typeof Object.create?n=Object.create(t):(s.prototype=t,n=new s,s.prototype=null),e&&i(!0,n,e),n}function e(e,n,s,r){var o=this;return"string"!=typeof e&&(r=s,s=n,n=e,e=null),"function"!=typeof n&&(r=s,s=n,n=function(){return o.apply(this,arguments)}),i(!1,n,o,r),n.prototype=t(o.prototype,s),n.prototype.constructor=n,n.class_=e||o.class_,n.super_=o,n}function i(t,e,i){for(var n,s,a=0,h=(i=o.call(arguments,2)).length;a<h;a++){s=i[a];for(n in s)t&&!r.call(s,n)||(e[n]=s[n])}}function n(){}var s=function(){},r=Object.prototype.hasOwnProperty,o=Array.prototype.slice,a=e;n.class_="Nevis",n.super_=Object,n.extend=a;var h=n,f=h.extend(function(t,e,i){this.qrious=t,this.element=e,
@nfarshchi
nfarshchi / QRScanVC.swift
Created February 19, 2018 22:12
Binary/Raw data from QR Code scanning with swift 4.0 by AVFoundation.
//
// QRScanVC.swift
//
// Created by Farshchi, Navid on 1/2/18.
//
import UIKit
import AVFoundation
class QRScanVC: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
@FaHuSchmidt
FaHuSchmidt / readme.md
Last active August 1, 2022 07:02
1&1 Webhosting SSH-Zugang

SSH-Verbindung mit Benutzername und Passwort aufbauen

ssh [user]@[host]

Passwort bei Aufforderung eingeben

SSH-Ordner im Benutzerverzeichnis anlegen

@rchrd2
rchrd2 / test-php-basic-auth.php
Last active February 1, 2024 21:18 — forked from westonruter/test-php-basic-auth.php
PHP basic auth example
<?php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'admin';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS