Skip to content

Instantly share code, notes, and snippets.

View vikrum's full-sized avatar
🎯
Focusing

vikrum vikrum

🎯
Focusing
View GitHub Profile
@vikrum
vikrum / AndroidManifest.xml
Last active April 6, 2024 12:00
Firebase+Android sample app with background Service + local notifications.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bgfirebaseapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
@vikrum
vikrum / .osx
Last active December 14, 2023 00:48
Vikrum's Most Excellent Antiques, Curiosities, and Dotfiles
defaults write com.apple.Safari IncludeDebugMenu 1
defaults write com.apple.dock no-bouncing -bool TRUE
defaults write com.apple.notificationcenterui bannerTime 1
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0.01
killall Dock
@vikrum
vikrum / ping.11.sh
Last active September 1, 2023 17:00
ping.11.sh
#!/bin/bash
# <xbar.title>ping</xbar.title>
# <xbar.version>v1.1</xbar.version>
# <xbar.author>Trung Đinh Quang, Grant Sherrick and Kent Karlsson</xbar.author>
# <xbar.author.github>thealmightygrant</xbar.author.github>
# <xbar.desc>Sends pings to a range of sites to determine network latency</xbar.desc>
# <xbar.image>http://i.imgur.com/lk3iGat.png?1</xbar.image>
# <xbar.dependencies>ping</xbar.dependencies>
# MIT License
#
# Copyright (c) April 2023 Vikrum Nijjar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@vikrum
vikrum / pun-whisperer.py
Last active May 2, 2023 16:51
If we can't use AI for terrible dad jokes and puns then what's the point?
# Infinite loop, record 30 sec from mic, transcribe, gpt3.5-turbo to tell a terrible dad joke/pun
# brew install portaudio ffmpeg
# pip install -r requirements.txt
import pyaudio
import wave
from pydub import AudioSegment
import openai
import os
@vikrum
vikrum / README.md
Last active May 28, 2021 20:00
Gold Fig blog code snippets

Gold Fig blog post queries, code snippets, and examples.

@vikrum
vikrum / firedns.js
Created January 14, 2013 18:56
A custom DNS server in NodeJS that saves off queries to Firebase so they can be retrieved later. Accompanying blog post: http://5f5.org/ruminations/dns-debugging-over-http.html
var crypto = require('crypto');
var dns = require('native-dns');
var rest = require('restler');
var server = dns.createServer();
server.on('request', function (request, response) {
var domain = request.question[0].name;
if(domain == 'webutils.flourishworks.com') {
// Don't log this because it can't be uniquely identified and subsequently retrieved
@vikrum
vikrum / oss-business-models.md
Last active March 29, 2021 21:20
Open Source/Open Core business model blog posts 2013-2020
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now/m-1m",
"lt": "now/m"
}
}
a4b
accessanalyzer
acm
acm-pca
alexaforbusiness
amplify
api
apigateway
apigatewaymanagementapi
apigatewayv2