Skip to content

Instantly share code, notes, and snippets.

View weikangchia's full-sized avatar

Wei Kang weikangchia

View GitHub Profile
@weikangchia
weikangchia / Android Studio .gitignore
Last active December 16, 2016 05:02
A .gitignore file for use in Android Studio with Gradle
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
@weikangchia
weikangchia / dialogflow_v2.js
Last active July 20, 2022 11:06
Generate DialogFlow V2 Access Token
const googleAuth = require('google-oauth-jwt');
function generateAccessToken() {
 return new Promise((resolve) => {
  googleAuth.authenticate(
   {
    email: <client_email>,
    key: <private_key>,
    scopes: 'https://www.googleapis.com/auth/cloud-platform',
   },
...
<groupId>com.github.khubite</groupId>
<artifactId>test</artifactId>
<version>0.0.0</version>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
...
<groupId>com.github.khubite</groupId>
<artifactId>test</artifactId>
<version>0.0.1</version>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>parse-version</id>
<goals>
<profiles>
<profile>
<id>bump-patch</id>
<activation>
<property>
<name>bumpPatch</name>
</property>
</activation>
<build>
<plugins>
<dependencies>
...
<dependency>
<artifactId>spark-core_2.12</artifactId>
<groupId>org.apache.spark</groupId>
<version>${spark.version}</version>
</dependency>
<dependency>
<artifactId>spark-sql_2.12</artifactId>
import java.lang.annotation.*;
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface JavaSparkContextField {}
import java.lang.annotation.*;
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface SparkSessionField {}