Skip to content

Instantly share code, notes, and snippets.

@algal
algal / loadPoints.swift
Created December 28, 2018 19:41
Read vertex positions with Model I/O
// known-good: Swift 4.2, macOS
import Foundation
import ModelIO
private func LogDebug(_ s:Any) -> Void { print(s) }
private func LogInfo(_ s:Any) -> Void { print(s) }
private func LogError(_ s:Any) -> Void { print(s) }
struct POINT3D {
var x:Float
@manuelvicnt
manuelvicnt / ProvideViewModels.kt
Last active May 2, 2024 17:16
Scope ViewModels to Composables
// PLEASE, READ
//
// This is a way to scope ViewModels to the Composition.
// However, this doesn't survive configuration changes or procress death on its own.
// You can handle all config changes in compose by making the activity handle those in the Manifest file
// e.g. android:configChanges="colorMode|density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode">
//
// This is just an exploration to see what's possible in Compose. We don't encourage developers to copy-paste
// this code if they don't fully understand the implications of it and if this actually solves the use case to solve.
@bennadel
bennadel / app.component.ts
Created May 1, 2018 12:42
Creating A Medium-Inspired Text Selection Directive In Angular 5.2.10
// Import the core angular services.
import { Component } from "@angular/core";
// Import the application components and services.
import { TextSelectEvent } from "./text-select.directive";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface SelectionRectangle {
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 2, 2024 17:11
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@dvf
dvf / change-codec.md
Last active May 2, 2024 17:10
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@JamesSimpson
JamesSimpson / perfex_hooks_list
Last active May 2, 2024 17:04
Full Perfex Hook List - For Perfex CRM Developers
File ---> application\controllers\admin\Authentication.php:
23: hooks()->do_action('admin_auth_init');
80: hooks()->do_action('after_staff_login');
107: hooks()->do_action('after_staff_login');
117: hooks()->do_action('after_staff_login');
219: hooks()->do_action('after_user_logout');
File ---> application\controllers\admin\Auto_update.php:
14: hooks()->do_action('before_perform_update', $latest_version);
@psu
psu / logseq-config-default-queries.edn
Last active May 2, 2024 17:02
logseq-config-default-queries.edn
;; Logseq Default Query 6-pack
;; ---------------------------
;;
;; Pontus Sundén (@psu)
;; October 28, 2022
;;
;; Attribution
;; - https://gist.github.com/sawhney17/3a1b04936f35df80253431a61cb74737
;;
;; ---------------------------
@favila
favila / datomic-counter.clj
Created September 29, 2017 16:23
Demonstrate the creation and use of an auto-increment counter (with nonce) in datomic
(require '[datomic.api :as d])
(d/create-database "datomic:mem://counter-example")
;=> true
(def c (d/connect "datomic:mem://counter-example"))
;=> #'user/c
;; The essential features of creating and using an auto-increment counter in datomic:
;;
;; 1. A counter entity must store the current value and a nonce.
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active May 2, 2024 16:58
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9