Skip to content

Instantly share code, notes, and snippets.

View baymac's full-sized avatar
👋

Parichay baymac

👋
View GitHub Profile
@baymac
baymac / Form.gs
Created January 1, 2019 21:04
App Script to send the response from Google Form to Firebase
function onFormSubmit(e) {
var form = FormApp.openById('1Z65umQSZ2drz3MvTWCWlwP4-ySeoB5D7RvX1LtusnEU');
var formResponses = form.getResponses();
var latestResponse = formResponses.length - 1;
var formResponse = formResponses[latestResponse];
var email = formResponse.getRespondentEmail();
var items = formResponse.getItemResponses();
@baymac
baymac / Git.md
Last active June 1, 2019 12:14
A list of basic git commands

This gist contains works of other users that I collected in the past but unfortunately I do not have references to them.

Initialise Git

To create a local repo and pushing to github repo:

echo "# shoppernet" >> README.md

git init
if [ "$#" -eq 1 ]; then
case $1 in
-u| --unset)
reset_proxy
exit 0
;;
*)
exit_with_usage
;;
esac
import androidhelper
import time
droid = androidhelper.Android()
droid.wakeLockAcquireFull()
arrived = 0
while True:
t = time.strftime("%I:%M %p")
@baymac
baymac / settings.xml
Created March 8, 2019 13:44
This will let you use short names for Jenkins Maven plugins (i.e. hpi:create instead of org.jenkins-ci.tools:maven-hpi-plugin:1.61:create), though this is unnecessary once you are already working in a plugin project (only useful for initial hpi:create).
<settings>
<pluginGroups>
<pluginGroup>org.jenkins-ci.tools</pluginGroup>
</pluginGroups>
<profiles>
<!-- Give access to Jenkins plugins -->
<profile>
<id>jenkins</id>
<activation>
// Contributor: julio641742
/*
In this example we will be click a button in the top bar,
causing an event that create a text label (hello world), which with some
animation, will be decreasing its opacity from 100% to 0%
*/
/* Import St because is the library that allow you to create UI elements */
const St = imports.gi.St;
@baymac
baymac / partial-pom.xml
Last active April 16, 2019 01:23
Adding the following lines to my pom to install local jar package. Ref: http://roufid.com/3-ways-to-add-local-jar-to-maven-project/
<project>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
@baymac
baymac / GitlabJenkins.md
Last active May 15, 2019 05:01
Releasing GitLab Branch Source Plugin to Jenkins

Hi all,

I am accepted to Google Summer of Code 2019 under Jenkins and my project is based on adding Multibranch Pipeline Support to GitLab.

Generally the SCM plugins are divided into 3 separate plugins, namely:

  1. SCM-api-plugin: For wrapping API into a plugin

  2. SCM-plugin: For build triggers, auth and webhooks management

@baymac
baymac / VS Code essentials.md
Last active May 22, 2019 09:06
Contains shortcuts and tricks for faster development on VS Code

Open terminal

Ctrl + ` - Within VS Code

Ctrl + Shift + C - External terminal

To avoid replacing new tabs by older ones

This is a hacky solution - Press Ctrl + C before opening a new tab

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading /home/parichay/.m2/repository/org/jenkins-ci/main/jenkins-core/2.138.4/jenkins-core-2.138.4.jar; zip file is empty
[ERROR] error reading /home/parichay/.m2/repository/org/jenkins-ci/main/jenkins-core/2.138.4/jenkins-core-2.138.4.jar; zip file is empty
[ERROR] /home/parichay/random codes/gitlab-branch-source-plugin-1/src/main/java/io/jenkins/plugins/gitlabserver/servers/GitLabServer.java:[36,1] cannot access hudson.model.Descriptor
class file for hudson.model.Descriptor not found
[ERROR] /home/parichay/random codes/gitlab-branch-source-plugin-1/src/main/java/io/jenkins/plugins/gitlabserver/credentials/PersonalAccessTokenImpl.java:[25,8] cannot access hudson.model.Describable
class file for hudson.model.Describable not found
[ERROR] /home/parichay/random codes/gitlab-branch-source-plugin-1/src/main/java/io/jenkins/plugins/gitlabserver/credentials/PersonalAccessTokenImpl.java:[65,19] cannot