Skip to content

Instantly share code, notes, and snippets.

Trung trungie

Block or report user

Report or block trungie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@balupton
balupton / README.md
Last active Nov 6, 2019
Convert XPS to PDF on Linux and Mac using bash
View README.md

Convert XPS to PDF on Linux and Mac

  1. Download this file

  2. chmod +x ./xps2pdf.bash

  3. To convert a particular xps file: ./xps2pdf.bash thefile.xps

  4. To convert all xps files in the current working directory: ./xps2pdf.bash *.xps

@duyetdev
duyetdev / duyetdev-spark-to-parquet.scala
Created Sep 21, 2016
Spark convert CSV to Parquet.
View duyetdev-spark-to-parquet.scala
def convert(sqlContext: SQLContext, filename: String, schema: StructType, tablename: String) {
// import text-based table first into a data frame.
// make sure to use com.databricks:spark-csv version 1.3+
// which has consistent treatment of empty strings as nulls.
val df = sqlContext.read
.format("com.databricks.spark.csv")
.schema(schema)
.option("delimiter","|")
.option("nullValue","")
.option("treatEmptyValuesAsNulls","true")
View JProfiler-with-Docker.md

JProfiler with Docker

Docker

DockerFile

DockerFile should have JProfiler installation.

RUN wget <JProfiler file location> -P /tmp/ && \
  tar -xzf /tmp/<JProfiler file> -C /usr/local && \
  rm /tmp/<JProfiler file>
View remove-gpg-user.sh
#!/bin/bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@jorihardman
jorihardman / sumo_logic.config
Last active Mar 28, 2018
Elastic Beanstalk Sumo Logic Config
View sumo_logic.config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# and edit L24-25 to match your Sumo Logic accessid and accesskey. To add or
# remove tracked files, simply add or remove source hashes to the sources
# array on L36.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
@topheman
topheman / jspm.travis.setup.md
Created Aug 4, 2015
Travis setup of Github token for jspm
View jspm.travis.setup.md
@staringispolite
staringispolite / asciiputsonglasses
Last active Oct 31, 2019
Ascii art sunglasses meme
View asciiputsonglasses
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
View PersistentCookieStore.java
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import java.io.*;
import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.net.URISyntaxException;
@JakeWharton
JakeWharton / AutoGson.java
Last active May 12, 2019
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
View AutoGson.java
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
You can’t perform that action at this time.