Skip to content

Instantly share code, notes, and snippets.

View trungie's full-sized avatar

Trung Hoang trungie

View GitHub Profile
@Notalifeform
Notalifeform / play_portal
Last active December 16, 2015 10:09
play! framework 1.x init.d file - could need some tuning; use for inspiration only :-)
#!/bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@burgalon
burgalon / gist:5579233
Last active March 9, 2017 00:55
Filter all extra logs "by Log Tax (regex)" in IntelliJ for Android adb logcat that are not relevant to debugging an app
^(?!.*(PullToRefresh|SherlockFragmentActivity|IInputConnectionWrapper|LightsService|CalendarSyncAdapter|Watson|ActionBarSherlock|alsa_ucm|mm-camera|qcom_sensors_hal|CellInfoLte|WirelessDisplayService|TELEPHONY_CALLBACK|StatusBar.*|memalloc|AlarmManager|SIGNAL_ICON|StateMachine|ThermalDaemon|overlay|AudioTrack|Trace|SyncManager|libEGL|GCMBaseIntentService|SubscribedFeeds|PackageManager|StorageNotification|libgps|DownloadManager|MountService|ActivityThread|SpannableStringBuilder|AlertService|Gmail|SurfaceFlinger|PhoneStatusBar|MtpService|PicasaUploader|chromium|BackupHelperDispatcher|BackupManagerService|PerformBackupTask|KeyInputQueue|LocationMasfClient|KeyguardViewMediator|WindowManager|InputDevice|jdwp|RecognizerEngine|VoiceDialerReceiver|PackageIntentReceiver|installd|UNA|VoldCmdListener|UnlockClock|sensor_stub|PowerManagerService|ExchangeService|EventLogService|Finsky|Zygote|BatteryService|SntpClient|ActivityManager|CalendarProvider2|SyncCampaign|AlarmScheduler|StatusBarPolicy|NetworkStatusReceiver|KeyChar
@Peksa
Peksa / MetricsPlugin.java
Created July 29, 2012 15:38
Codahale metrics with Play framework
package plugins;
import play.PlayPlugin;
import play.mvc.Http;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
import play.mvc.Router.Route;
import play.vfs.VirtualFile;
import util.MetricsUtil;
package com.mirth.stevek.rxtest;
import rx.Observable;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.functions.Func3;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
@warnergodfrey
warnergodfrey / gist:7512051
Last active September 21, 2018 03:20
Access the ATO Business Portal using AusKey Mac OS X Mountain Lion
  • Install the latest JRE from Oracle
  • In the Java Control Panel, go to the Security tab and make sure 'Enable Java Content' is checked
  • Open Safari
  • Go to the ATO Business portal site https://bp.ato.gov.au/BpStatics/homepage.htm
  • Click Login
  • A dialog will apear asking you 'Do you want to trust the website “authentication.business.gov.au” to use the “Java” plug-in?'
  • Click 'Trust'
  • Now you will be asked 'Do you want to run this application?'
  • Click 'Run'
  • Another dialog will appear asking you to 'Allow access to the following application from this website?'
@duyet
duyet / duyetdev-spark-to-parquet.scala
Created September 21, 2016 03:35
Spark convert CSV to Parquet.
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")
@topheman
topheman / jspm.travis.setup.md
Created August 4, 2015 18:49
Travis setup of Github token for jspm
@stephanos
stephanos / build.gradle
Created January 27, 2014 09:48
Gradle: Automate IntelliJ IDEA project generation for a Java App Engine project
def jvmRunFlags = '''
-Xmx700m
- ...
'''.split().toList()
def jvmTestFlags = '''
-Dlocally=true
-ea
- ...
'''.split().toList()
@kjoconnor
kjoconnor / gist:2484425
Created April 24, 2012 22:50
Install puppet-server on Amazon Linux
1. Paste into /etc/yum.repos.d/puppetlabs.repo
[puppetlabs]
name=Puppet Labs - $basearch
baseurl=http://yum.puppetlabs.com/el/6Server/products/$basearch
failovermethod=priority
priority=0
enabled=0
2. rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
@kabbi
kabbi / ota.ino
Created October 25, 2018 18:29
Base ArduinoOTA + WifiManager for esp8266
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <ArduinoOTA.h>
#include <WebSocketsClient.h>
#include <DNSServer.h>
void setup() {
Serial.begin(115200);