Skip to content

Instantly share code, notes, and snippets.

View palaniraja's full-sized avatar

palaniraja palaniraja

View GitHub Profile
@gingerbeardman
gingerbeardman / volumes.60s.sh
Last active February 25, 2025 13:51
xbar/bitbar shell script to list and clean and eject (unmount using option) volumes as a replacement for CleanMyDrive
#!/bin/zsh
# <bitbar.title>Volume Manager</bitbar.title>
# <bitbar.version>250225</bitbar.version>
# <bitbar.author>Matt Sephton</bitbar.author>
# <bitbar.author.github>gingerbeardman</bitbar.author.github>
# <bitbar.desc>Lists and manages mounted user volumes</bitbar.desc>
# <bitbar.dependencies>zsh</bitbar.dependencies>
# <bitbar.abouturl>https://gist.github.com/gingerbeardman/610f22180117ad20465d7c529cc5faa0</bitbar.abouturl>
setopt EXTENDED_GLOB
@bjhomer
bjhomer / cross-view-lines.swift
Last active November 5, 2022 05:31
Creating cross-view lines in SwiftUI
//
// ContentView.swift
// SwiftUIPlayground
//
// Created by BJ Homer on 4/26/21.
//
import SwiftUI
@lisamelton
lisamelton / manuscript.latex
Last active May 23, 2022 14:46
LaTeX template for Pandoc to create PDFs in standard manuscript format with both short story and novel layouts.
%
% manuscript.latex
%
% Copyright (c) 2022 Don Melton
%
% LaTeX template for Pandoc to create PDFs in standard manuscript format
% with both short story and novel layouts.
%
% Version: 2022052301
%
import UIKit
extension UITextField {
/// Add a trailing placeholder label that tracks the text as it changes
func addTrailingPlaceholder(_ placeholder: String) {
let label = UILabel()
label.text = placeholder
label.alpha = 0.3
label.isHidden = true
let container = UIView()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASCII to Binary</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<style>
body {
@kevinjalbert
kevinjalbert / mirror.scpt
Last active March 30, 2025 21:44
AppleScript to Mirror iPhone to QuickTime
set deviceName to "Kevin’s iPhone"
activateScreenKeepAwake()
readyQuickTime()
setVideoInput(deviceName)
setAudioInput(deviceName)
setVolume(1.0)
setScreenSize("maximize")
# ----- Functions -----
@typesanitizer
typesanitizer / Assembly intro comic.md
Created October 24, 2020 22:22
Assembly intro comic - textual version

Assembly is wacky but cool!

Author: Varun Gandhi (@typesanitizer)

Panel 1

Compilers generate assembly in the penultimate stage of compilation.

The assembly is processed by an assembler, which generates machine code for subsequent processing by a linker.

@fxm90
fxm90 / Combine-CLLocationManagerDelegate.swift
Last active July 13, 2023 09:15
Playground showing how to convert a delegate pattern to combine publishers.
//
// Combine-CLLocationManagerDelegate.playground
//
// Created by Felix Mau on 30.07.20.
// Copyright © 2020 Felix Mau. All rights reserved.
//
import PlaygroundSupport
import Combine
import CoreLocation
@Dornhoth
Dornhoth / index.js
Created April 5, 2020 17:45
WebRTC with Screen Sharing
(function () {
"use strict";
const MESSAGE_TYPE = {
SDP: 'SDP',
CANDIDATE: 'CANDIDATE',
}
let code;
let peerConnection;
@chockenberry
chockenberry / Debug.swift
Last active April 11, 2024 13:22
Debug and release logging in Swift that's reminiscent of NSLog()
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Updated by Craig Hockenberry on 2/20/24.
// Usage:
//
// SplineReticulationManager.swift:
//