Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Osmar Leon Ingaruca jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / GoogleClient.java
Created Sep 26, 2021
google oauth2 java client, googleoaauth2
View GoogleClient.java
package org.jrichardsz.horus.third.google.client;
import java.util.Map;
import org.jrichardsz.horus.exceptions.BadGoogleResponseException;
import org.jrichardsz.horus.exceptions.GoogleOauthRestApiException;
public interface GoogleClient {
public String getAuthorizeUrl(String redirectUri, String scope, String clientId);
@jrichardsz
jrichardsz / DatabaseResultToParser.java
Created Sep 26, 2021
sql to json , sqltojson DatabaseResultToParser.java
View DatabaseResultToParser.java
package org.jrichardsz.horus.common;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class DatabaseResultToParser {
View youtube screen.md
  • just create a book mark with this url
  • play the video and stop it
  • click in the bookmark
javascript:"use strict";!function(window,document){var canvas=document.createElement("canvas"),video=document.querySelector("video"),ctx=canvas.getContext("2d");canvas.width=parseInt(video.offsetWidth),canvas.height=parseInt(video.offsetHeight),ctx.drawImage(video,0,0,canvas.width,canvas.height);var base64ImageData=canvas.toDataURL("image/jpeg"),filename="snap-"+canvas.width+"x"+canvas.height+"-"+video.currentTime+".jpg",a=document.createElement("a");a.download=filename,a.href=base64ImageData;var img=document.createElement("img");img.src=base64ImageData,img.alt=filename,img.title="Click to save "+filename,window.open().document.body.appendChild(a).appendChild(img)}(window,document);

https://github.com/ReeganExE/youtube-screenshot

@jrichardsz
jrichardsz / yaml java groovy research.md
Created Sep 17, 2021
yaml java groovy research.md
View yaml java groovy research.md

sample

volumes:
- name: wordpress-persistent-storage
  persistentVolumeClaim:
    claimName: wp-pv-claim

research findings

@jrichardsz
jrichardsz / min.js
Created Sep 17, 2021
scratch js snippet
View min.js
function Sprite(e,t,i){this.x=e,this.y=t,this.direction=0,this.isHidden=!1,spritesArray.push(this);var n=this;this.updateLocation=function(){this.element.style.left=page.originOffsetX+this.x+"px",this.element.style.top=page.originOffsetY-this.y+"px"},this.updateX=function(){this.element.style.left=page.originOffsetX+this.x+"px"},this.updateY=function(){this.element.style.top=page.originOffsetY-this.y+"px"},this.updateRotation=function(){this.element.style.transform="rotate("+-1*this.direction+"deg)"},this.resize=function(e){var t=this.element.clientWidth;this.element.width=t*e};var s=/<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|ma
View kubernetes snippets.md
@jrichardsz
jrichardsz / docker filter format dockerfilter dockerformat.md
Created Sep 13, 2021
docker filter format dockerfilter dockerformat
View docker filter format dockerfilter dockerformat.md

search specific images by name and

docker images -a --format '{{.Repository}} {{.Tag}} {{.ID}}' | grep 'acme-api' |awk '$2 ~ "none" {print $3}'

delete untagged images

docker rmi $(docker images -a --format '{{.Repository}} {{.Tag}} {{.ID}}' | grep 'acme-api' |awk '$2 ~ "none" {print $3}')
@jrichardsz
jrichardsz / linux prompt customization.md
Last active Sep 29, 2021
linux prompt customization
View linux prompt customization.md

hide path

#1
export PS1="\u >"

#2
export PS1="\u :"