Skip to content

Instantly share code, notes, and snippets.

View nisrulz's full-sized avatar
🌌
Coding in the MultiVerse

Nishant Srivastava nisrulz

🌌
Coding in the MultiVerse
View GitHub Profile
@wlib
wlib / LICENSE
Last active June 10, 2022 22:14
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
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:
@caseywatts
caseywatts / 0 push to talk.md
Last active September 21, 2023 13:55
Push To Talk - Google Meet Bookmarklet

Short link to this page: http://caseywatts.com/ptt

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Push To Talk in a Google Hangout (Meet)

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
  • Name: PTT (push to talk) or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
@aquaflamingo
aquaflamingo / deployApks.groovy
Last active May 13, 2019 18:25
Gradle task to archive APKs once built through android studio by running ./gradlew deployApks
task deployApks(type:Copy) {
description = "Copies APKs and Proguard mappings to the deploy directory"
def appName = "posture";
def versionDir = android.defaultConfig.versionName+"_"+android.defaultConfig.versionCode;
println("Copies APK and Proguard to " + versionDir)
from 'build/outputs/mapping/release/'
include '**/mapping.txt'
into '../.admin/deploy/' + versionDir
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@kaushikgopal
kaushikgopal / pre-commit
Last active April 19, 2023 09:22
pre-commit git hook - no "hacking"
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
def current_branch()
branches = `git branch --no-color`.split(/\n/)
@ph0b
ph0b / app_build.gradle
Last active November 20, 2019 09:21
config example on Multiple APK support and mixing gradle-stable and gradle-experimental plugin, for NDK-enabled Android projects. To support AS 2.0 debug, just add lib/build/intermediates/binaries/release/obj/[abi] to Symbol directories
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.example.yourapp"
minSdkVersion 16
targetSdkVersion 23
@kaushikgopal
kaushikgopal / update.sh
Last active February 1, 2022 16:36
My morning cli ritual
echo "y" | android update sdk --no-ui; echo "yes" | apm upgrade; softwareupdate -i -a; brew update; brew upgrade; brew cleanup; brew cask cleanup; npm update npm -g; npm update -g; gem update
@rohanag12
rohanag12 / SslUtil.java
Last active April 5, 2024 16:28
Create an SslSocketFactory using PEM encrypted certificate files
/**
* Utility class to read encrypted PEM files and generate a
* SSL Socket Factory based on the provided certificates.
* The original code is by Sharon Asher (link below). I have modified
* it to use a newer version of the BouncyCastle Library (v1.52)
*
* Reference - https://gist.github.com/sharonbn/4104301"
*/
import org.bouncycastle.cert.X509CertificateHolder;
@kaushikgopal
kaushikgopal / RoundedBitmapDrawableUsage.java
Last active March 25, 2024 13:55
RoundedImageView - drop dead easy way to do this with RoundedBitmapDrawable
Bitmap batmapBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.batman);
RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), batmapBitmap);
// option 1 h/t [Chris Banes](https://chris.banes.me/)
circularBitmapDrawable.setCornerRadius(batmapBitmap.getWidth());
// option 2 h/t @csorgod in the comments
circularBitmapDrawable.setCircular(true);
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software