Skip to content

Instantly share code, notes, and snippets.

@Volcanoscar
Volcanoscar / install_zsh.sh
Created July 22, 2022 00:44
Script for installing zsh with powerlevel10k theme on linux platform
#!/bin/bash
if [ "$1" = "clean" ];
then
echo "Removing ZSH config"
rm -rf ~/.zsh
rm ~/.zshrc
rm ~/.p10k.zsh
chsh -s $(which bash)
exit
@Volcanoscar
Volcanoscar / jsonval.sh
Created September 29, 2021 10:52 — forked from cjus/jsonval.sh
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`
@Volcanoscar
Volcanoscar / build.gradle
Created May 19, 2021 08:36 — forked from ocus/build.gradle
Android Library Project - Copy AAR from build/outputs/aar/PROJECT-VARIANT.aar to build/PROJECT-VARIANT-VERSION_NAME.aar after each assembleVARIANT task
android.libraryVariants.all { variant ->
def variantName = variant.name.capitalize()
def copyTaskName = "copy${variantName}Artifacts"
def assembleTaskName = "assemble${variantName}"
task(copyTaskName, type: Copy, dependsOn: assembleTaskName, group: "build") {
variant.outputs.each { output ->
def newOutputName = output.outputFile.name.replace(".aar", "-" + android.defaultConfig.versionName + ".aar")
from(output.outputFile.parent) {
include output.outputFile.name
rename output.outputFile.name, newOutputName
Error:
$ adb devices
List of devices attached
52003c2b58b445db no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
Fix:
1> sudo usermod -aG plugdev $LOGNAME (https://developer.android.com/studio/run/device)
2> lsusb
3> sudo vi /etc/udev/rules.d/51-android.rules
@Volcanoscar
Volcanoscar / Resume2019.md
Created October 19, 2019 16:22 — forked from padmapriya831/Resume2019.md
Padmapriya resume

Objective

Self-motivated, detailed-oriented person, looking for a development role in business reporting.

Professional Summary

  • Software Engineer with technical experience in design, development and testing of Oracle SQL Reports
  • Strong Experience – Managing client interactions, mapping business requirements, technical design, development, design/code review and unit/integration testing.
  • Mentored new members of the team and helped them with ramp-up
@Volcanoscar
Volcanoscar / video conversion
Created August 30, 2019 11:11 — forked from tranthamp/video conversion
Some video / image conversion commands
// List available formats for ffmpeg
ffmpeg -pix_fmts
// Convert a 720x480 nv12 (yuv 420 semi-planar) image to png
ffmpeg -s 720x480 -pix_fmt nv12 -i captdump-nv12.yuv -f image2 -pix_fmt rgb24 captdump.png
// Convert a 640x480 uyvy422 image to png
ffmpeg -s 640x480 -pix_fmt uyvy422 -i frame-000003.yuv -f image2 -pix_fmt rgb24 captdump.png
// Display a 640x480 grayscale raw rgb file
@Volcanoscar
Volcanoscar / YUV420PGrabber.cpp
Created August 16, 2019 12:31 — forked from roxlu/YUV420PGrabber.cpp
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include "YUV420PGrabber.h"
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
,uv_prog(0)
@Volcanoscar
Volcanoscar / OkHttp3Stack.java
Created April 9, 2019 14:39 — forked from SylvainHocq/OkHttp3Stack.java
An OkHttp backed HttpStack for Volley (okhttp3 version)
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* 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
@Volcanoscar
Volcanoscar / OkHttpStack.java
Created April 9, 2019 14:23 — forked from JakeWharton/OkHttpStack.java
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@Volcanoscar
Volcanoscar / colorspaces.glsl
Created November 3, 2018 13:58 — forked from msbarry/colorspaces.glsl
glsl color space conversion
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}