Skip to content

Instantly share code, notes, and snippets.

View kishorek's full-sized avatar

Kishore Kumar Uthirapathy kishorek

View GitHub Profile
@jeffersonlicet
jeffersonlicet / script.js
Created May 31, 2024 01:18
Stop ChatGPT Web Memory Leak
window.original = window.addEventListener;
window.addEventListener = function (type, listener, options) {
if (type === "DOMContentLoaded") {
console.warn(
"Adding new DOMContentLoaded event listeners has been blocked."
);
return;
}
@thomwolf
thomwolf / fast_speech_text_speech.py
Last active July 21, 2024 18:37
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@jeffsheets
jeffsheets / exportImportJavaCert.md
Last active April 6, 2023 16:29
Bash Commands to Export Cert and Import into Java Truststore

Command to export a cert from a website to a .cer file (example uses google.com) Tested with git-bash shell on Windows. Assume similar on Mac?

openssl s_client -servername google.com -connect google.com:443 </dev/null 2>/dev/null | openssl x509 -inform PEM -outform DER -out google.com.cer

Command to import into local java truststore (use your own location of JAVA_HOME)

"$JAVA_HOME"/bin/keytool -keystore "$JAVA_HOME"/lib/security/cacerts -importcert -alias google.com -file google.com.cer

@JeOam
JeOam / Animation.md
Last active July 11, 2024 03:30
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

Author: https://www.cyanhall.com/

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

@peel
peel / gist:ca8c5b25efbe3052fdb5
Last active May 11, 2022 21:17
SJ4000 WIFI Protocol

#Base URL http://192.168.1.254

File Management Panel

GET / file management panel

Configuration options

all options follow the template: /?custom=1&cmd={Command}&par={Option} Command - setting/mode of the device

@AnuragMishra
AnuragMishra / DateParsingPerformanceComparison.m
Last active July 29, 2020 17:20
Compare the date parsing performance of NSDateFormatter against SQLite's date parser for parsing an iOS 8601 date.
#import <Foundation/Foundation.h>
#import "sqlite3.h"
typedef int64_t timestamp;
NSUInteger randomNumberInRange(NSUInteger start, NSUInteger end);
// Create a sample date using the ISO-8601 format.
// 2013-04-23T16:29:05Z
NSString* generateSampleDate();
@brentsimmons
brentsimmons / gist:5810992
Last active January 3, 2021 02:22
Detect a tap on a URL inside a UITextView. Note: the rs_links method isn't included -- you'll need something that takes text and returns an array of detected links. This gist just demonstrates walking through the UITextView characters.
@implementation UITextView (RSExtras)
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) {
/*[s length] is assumed to be 0 or 1. s may be nil.
Totally not a strict check.*/
if (s == nil || [s length] < 1)
return NO;
@codeswimmer
codeswimmer / gcd_timer.m
Created October 12, 2012 20:06
iOS:OSX: Timer Using GCD
-(dispatch_source_t)createTimerWithQueue:(dispatch_queue_t)queue block:(dispatch_block_t)handler
{
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
if (timer) {
uint64_t seconds = 30ull;
uint64_t interval = seconds * NSEC_PER_SEC;
uint64_t leeway = 1ull * NSEC_PER_SEC;
dispatch_source_set_timer(timer, dispatch_walltime(NULL, 0), interval, leeway);
@slaypni
slaypni / PBPopupBanner.java
Created October 2, 2012 07:45
A class for showing a view as pop-up [Android]
package com.example.utils;
import android.app.Activity;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
@jamiely
jamiely / offline_map.md
Created September 1, 2012 19:17
Generating offline maps for iOS applications

Intro

Recently, I had to implement an offline mapping solution for an iOS application. Here's a walkthrough of how to do it.

Summary

I generated a tile database using TileMill. I used the Route-Me iOS library which provides a map view that supports offline tile sources.

TileMill