Skip to content

Instantly share code, notes, and snippets.

View palaniraja's full-sized avatar

palaniraja palaniraja

View GitHub Profile
@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/vue@2.6.14"></script>
<style>
body {
@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:
//
@keith
keith / simctl-commands.txt
Last active December 7, 2022 23:27
All the subcommands of `xcrun simctl` (including ones that aren't listed in `simctl help`) LC_SOURCE_VERSION 776.1 (Xcode 13.0 beta 5)
addmedia
addphoto
addvideo
appinfo
boot
bootstatus
clone
create
darwinup
delete
@neilalexander
neilalexander / example.go
Created January 9, 2019 22:44
macOS/iOS: Writing to NSLog using Golang (using Cgo)
package myapp
import "log"
...
mobilelog := MobileLogger{}
logger := log.New(mobilelog, "", 0)