Skip to content

Instantly share code, notes, and snippets.

View wwwonka's full-sized avatar

wwwonka

  • 37°37'41.3"N 116°50'54.5"W
View GitHub Profile
#!/usr/bin/env bash
#Thanks to Craig Hair for crafting this magic.
ARRAY=()
ARRAY=( "0:0"
"1:Grey"
"2:Space Grey"
"3:Yellow"
"4:Green"
"5:Blue"
@lancethomps
lancethomps / close_notifications_applescript.js
Last active April 8, 2024 07:43
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@avaidyam
avaidyam / BackdropView.swift
Created July 2, 2020 17:23
DIY NSVisualEffectView using Private API for macOS
// TODO: setting window transforms (or mission control) flattens layers...
// TODO: Mask image vs path (layer)?
/// `NSVisualEffectView`:
///
/// A view that adds translucency and vibrancy effects to the views in your interface.
/// When you want views to be more prominent in your interface, place them in a
/// backdrop view. The backdrop view is partially transparent, allowing some of
/// the underlying content to show through. Typically, you use a backdrop view
/// to blur background content, instead of obscuring it completely. It can also
@THeK3nger
THeK3nger / ShaderLoader.js
Created October 27, 2016 09:29
THREE.js Asynchronous Shader Loader
// This is a basic asyncronous shader loader for THREE.js.
function ShaderLoader(vertex_url, fragment_url, onLoad, onProgress, onError) {
var vertex_loader = new THREE.XHRLoader(THREE.DefaultLoadingManager);
vertex_loader.setResponseType('text');
vertex_loader.load(vertex_url, function (vertex_text) {
var fragment_loader = new THREE.XHRLoader(THREE.DefaultLoadingManager);
fragment_loader.setResponseType('text');
fragment_loader.load(fragment_url, function (fragment_text) {
onLoad(vertex_text, fragment_text);
});
@chatchavan
chatchavan / Chat's email etiquette.md
Last active November 17, 2021 10:25
Thoughts on email communcation

Sending email to Chat

  • Send short emails. (If things are complicated, ask me to get back to you face-to-face or Skype)
  • One topic per email. (If you have some requests about teaching and others about research, send two emails.)
  • Highlight important keywords in bold.
  • If you want Chat to do something:
    • Group all action items together in bullet points at the end of the email.
  • If you want to make an appointment:
    • Propose 3 slots that you are convenient in the email.
  • Attach iCal calendar items
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@MAKIO135
MAKIO135 / index.html
Last active August 22, 2019 22:53
Using canvas as ThreeJS texture
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body style="background:#fff;">
<script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"></script>
<canvas id="canvas"></canvas>
<script id="jsbin-javascript">
@magicznyleszek
magicznyleszek / multiply-blending-mode-to-png.md
Created August 20, 2014 11:27
Multiply blending mode to PNG in Photoshop
  1. copy your image (Ctrl+A and Ctrl+C)
  2. make a new document-sized pure-black layer behind it
  3. group the black layer and yor image together
  4. add mask to the group
  5. enter mask edit mode (alt+click on the mask icon/thumbnail)
  6. paste your image in the mask (b/w) and then invert it.
  7. save it as a 24-bit transparent PNG
// ============================================================ //
// CAST
// ============================================================ //
window.chrome = {};
window.chrome.cast = {};
window.chrome.cast.isAvailable = true;
window.chrome.cast.initialize = function(a, b, c) { }
window.chrome.cast.ApiConfig = function(a, b, c) {
// This fakes that chromecast is available so the button appears
// call anything other than "available" to fake chromcast dissapearing
@demonixis
demonixis / toggleFullscreen.js
Created March 18, 2013 16:07
A simple function to toggle fullscreen in JavaScript. It work well on Firefox and Webkit browsers.
/**
* Toggle fullscreen function who work with webkit and firefox.
* @function toggleFullscreen
* @param {Object} event
*/
function toggleFullscreen(event) {
var element = document.body;
if (event instanceof HTMLElement) {
element = event;