Skip to content

Instantly share code, notes, and snippets.

View shauvik's full-sized avatar

Shauvik RC shauvik

View GitHub Profile
@shauvik
shauvik / google-wifi-setup-centurylink.md
Last active September 17, 2020 03:30 — forked from dotspencer/google-wifi-setup-centurylink.md
How to use Google WiFi with CenturyLink Internet
@shauvik
shauvik / git.zsh
Last active July 21, 2020 15:56
Git commands
# show commits on a day
for d ({1..21}) {git log --pretty=format:"%h %ad" --after="2020-07-$d 00:00" --before="2020-07-$d 23:59" | wc -l}
@shauvik
shauvik / run.sh
Created June 1, 2020 19:04
Run android sample
$ git clone https://github.com/android/testing-samples
$ cd testing-samples/ui/espresso/BasicSample
$ ./gradlew cAT
> Configure project :app
WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is experimental and unsupported.
The current default is 'false'
> Task :app:connectedDebugAndroidTest
@shauvik
shauvik / Bluetooth.kt
Last active May 6, 2019 21:22
Bluetooth handling in FixApp
package com.fixdapp.android
import android.bluetooth.BluetoothDevice
/* Interfaces */
data class ErrorCode(val code: String)
interface SensorService {
fun scanForSensors(): List<Sensor>
fun connectToSensor(sensor: Sensor): DiagnosticInterface
@shauvik
shauvik / build.log
Last active August 1, 2017 18:43
Building UIKitCatalog -- all flavors
$ xcodebuild
$ xcodebuild -configuration Debug
$ xcodebuild -sdk iphonesimulator
$ xcodebuild -sdk iphonesimulator -configuration Debug
$ cd build
$ ls
Debug-iphoneos Release-iphoneos UIKitCatalog.build
Debug-iphonesimulator Release-iphonesimulator
@shauvik
shauvik / iframe.html
Created April 11, 2017 16:47
multiple htmls in one iframe
<html>
<head>
<style>
#main {
width: 100%;
height: 100%;
border: 1px solid black;
display: -webkit-flex; /* Safari */
display: flex;
}
@shauvik
shauvik / install-pre-commit.sh
Last active May 27, 2021 05:37 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# RUN THIS SCRIPT
# curl -fL https://gist.githubusercontent.com/shauvik/7175fa008bb29e83a86a6795159a893f/raw/install-pre-commit.sh | sh -s pre-commit-3
# Original stuff.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
@shauvik
shauvik / car-simulator.js
Created October 20, 2016 21:36
Print Autonomous Car Events to console
(function() {
"use strict";
var events = [
"INFO: Car passed on the right",
"INFO: Car passed on the left",
"SIGN: STOP sign ahead",
"SIGN: Signal turned RED",
"SIGN: Signal turned GREEN",
"WARN: Car stopped ahead",
@shauvik
shauvik / data.tsv
Last active March 29, 2016 16:00
D3 data
letter frequency
A .08167
B .01492
C .02782
D .04253
E .12702
F .02288
G .02015
H .06094
I .06966
@shauvik
shauvik / puma.sh
Created March 15, 2016 19:30
PUMA
app="/path/to/app-debug.apk"
TOOLDIR="/path/to/puma"
RESULTSDIR="path/to/results"
echo "** PROCESSING APP " $app
package=`aapt d badging $app | grep package: | awk -F\' '{print $2}'`
appLabel=`aapt d badging $app | grep application-label: | awk -F\' '{print $2}'`
echo $package > $TOOLDIR/app.info
echo $appLabel >> $TOOLDIR/app.info