Skip to content

Instantly share code, notes, and snippets.

@Volcanoscar
Volcanoscar / install_zsh.sh
Created Jul 22, 2022
Script for installing zsh with powerlevel10k theme on linux platform
View install_zsh.sh
#!/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 Sep 29, 2021 — forked from cjus/jsonval.sh
Extract a JSON value from a BASH script
View jsonval.sh
#!/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 — 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
View build.gradle
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
View fix adb devices no permission
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
View Resume2019.md

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 Aug 30, 2019 — forked from tranthamp/video conversion
Some video / image conversion commands
View video conversion
// 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 Aug 16, 2019 — forked from roxlu/YUV420PGrabber.cpp
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
View YUV420PGrabber.cpp
#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 Apr 9, 2019 — forked from SylvainHocq/OkHttp3Stack.java
An OkHttp backed HttpStack for Volley (okhttp3 version)
View OkHttp3Stack.java
/**
* 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 Apr 9, 2019 — forked from JakeWharton/OkHttpStack.java
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
View OkHttpStack.java
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 Nov 3, 2018 — forked from msbarry/colorspaces.glsl
glsl color space conversion
View colorspaces.glsl
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);
}