Skip to content

Instantly share code, notes, and snippets.

View yogen-p's full-sized avatar
🤯
Coding

Yogen P yogen-p

🤯
Coding
View GitHub Profile
private fun loadJSONFromAsset(context: Context, name: String): String {
var json = ""
try {
val inputStream = context.applicationContext.assets.open(name)
val size = inputStream.available()
val buffer = ByteArray(size)
inputStream.read(buffer)
inputStream.close()
json = String(buffer, Charsets.UTF_8)
} catch (ioException: IOException) {
package com.yogenp.globalcodetest
import android.content.ComponentName
import android.content.Intent
import android.os.Bundle
import androidx.core.util.Preconditions
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentFactory
import androidx.fragment.app.testing.FragmentScenario
import androidx.test.core.app.ActivityScenario
sudo apt install -y cmake gimp git git-core htop intel-microcode libatlas-base-dev libblas-dev libmysqlclient-dev liblapack-dev libopenblas-base linux-image-extra-virtual mysql-server openssh-server vlc python-dev software-properties-common software-properties-gtk
# tor-browser
sudo apt install -y torbrowser-launcher
# skype
sudo dpkg -i skypeforlinux-64.deb
# sublime
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
# Common Internet File System utilities
# Wed Aug 8 12:34:05 IST 2018
sudo apt-get install cifs-utils
# Modern music player and library organiser inspired by Amarok 1.4
# Tue May 22 13:21:25 IST 2018
sudo apt-get install clementine
# cross-platform, open-source make system
# Sun Feb 18 17:55:21 IST 2018
#!/usr/bin/env bash
s=$(date +%s | cut -b1-13)
while true
do
export DISPLAY=:0.0
battery_percent=$(acpi -b | grep -P -o '[0-9]+(?=%)')
if on_ac_power; then
if [ "$battery_percent" -gt 90 ]; then
s=$(date +%s | cut -b1-13)
notify-send -i notification-power-disconnected -t 6000 "Battery full." "Level: ${battery_percent}% "