Skip to content

Instantly share code, notes, and snippets.

View jpukg's full-sized avatar
🧭
Full Stack Developer (Java, Angular)

Jayaprakash (JP) jpukg

🧭
Full Stack Developer (Java, Angular)
View GitHub Profile
@jpukg
jpukg / SpringGuavaCache.java
Created February 19, 2018 16:48 — forked from abhin4v/SpringGuavaCache.java
An implementation of the Spring Cache interface on top of Google Guava cache
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;
import com.google.common.base.Optional;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheBuilderSpec;
@jpukg
jpukg / WindowsExeFile.java
Created September 23, 2017 17:30 — forked from rponte/WindowsExeFile.java
Executing Windows exe file with Java using ProcessBuilder.
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
public class WindowsExeFile {
private final File file;
public WindowsExeFile(String rawPath) {
this.file = convertToFile(rawPath);
@guillaumegarcia13
guillaumegarcia13 / sample.html
Created September 4, 2017 15:53
Angular 4 ng-template & ng-container with parameters
<ng-template #followingpost let-author="author" let-age="age" let-text="text" let-badge="badge">
<div class="container-fluid">
<div class="card">
<div class="header">
<h4 class="title">{{ author }}</h4>
<p class="category">il y a {{ age }} jours</p>
</div>
<div class="content" [innerHTML]="text">
</div>
@alejandro-du
alejandro-du / gist:3b417f3c5c83bf15571c59f0158c1672
Created May 2, 2017 09:56
Vaadin 8.1 - Grid Drag and Drop example
package com.example;
import com.vaadin.shared.ui.grid.DropMode;
import com.vaadin.ui.Grid;
import com.vaadin.ui.GridDragSource;
import com.vaadin.ui.GridDropTarget;
import com.vaadin.ui.VerticalLayout;
import java.util.List;
@xSAVIKx
xSAVIKx / Demo.java
Created March 20, 2017 20:54
JAXB Custom Adapter Example
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
/**
* Created by User on 20.03.2017.
*/
public class Demo {
public static void main(String[] args) throws JAXBException {
JAXBContext context = JAXBContext.newInstance(Type.class, InnerType.class);
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 4, 2025 00:59
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

Object Oriented Ideas

Why

  • Represent our ideas
  • Manage Complexity

Generic OO Terms

  • Abstraction - Figuring out what abstractions express our requirements
  • Polymorphism - Using multiple abstractions in the same way
  • Inheritance - Sharing Implementation
@stephen-maina
stephen-maina / Email functionalitoes javamail
Last active November 21, 2022 19:51
Basic Email activities using javamail and saving of files on a cloud storage facility eg. AWS
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
@michaljemala
michaljemala / tls-client.go
Last active May 23, 2025 01:11
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@raineorshine
raineorshine / built-in.md
Created March 12, 2014 18:23
55 Must Know Built-In Javascript Methods and Operators