Skip to content

Instantly share code, notes, and snippets.

View erlangparasu's full-sized avatar

Erlang Parasu erlangparasu

View GitHub Profile
@jojobyte
jojobyte / ContextCmder-Disable.reg
Last active February 8, 2025 01:56
Cmder Context (Right-Click) Menu for Windows 7, 8, 10 & 11
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@ashleydw
ashleydw / nginx.conf
Last active January 5, 2025 13:23
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@skynetbinary
skynetbinary / Getting Started: Android Development with Gradle (without Android Studio).md
Last active July 11, 2024 19:24
Getting Started: Android Development with Gradle (without Android Studio)

Getting Started: Android Development with Gradle (without Android Studio)

Install JDK

Open Terminal. Type javac -version and check your current JDK version. If you seem to have javac 1.7.* JDK version, you can skip this section.

  • Open Termianl.
  • Type sudo apt-get install openjdk-7-jdk.

Download Android SDK (standalone tools)

@guykisel
guykisel / gist:fdc3bb48392a4d871140
Created January 22, 2015 18:39
Jenkins Best Practices
Jenkins Best Practices
https://en.wikipedia.org/wiki/Continuous_integration<- Read this!
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Best+Practices
http://www.slideshare.net/andrewbayer/7-habits-of-highly-effective-jenkins-users
Set up version control of job configurations
Keep jobs simple! Don't put a ton of bash in each job. If a job needs to do something complex, put it in a script in GitHub and check it out as needed.
Use templated builders to simplify common tasks
Keep all scripts in version control - avoid running scripts that live on the Jenkins server filesystem
Don't install unnecessary plugins - plugins are often written by third parties and can interact with each other in strange ways
Use LDAP authentication if possible for traceability - avoid anonymous access
@taworn
taworn / overridePendingTransition.snippets
Last active September 22, 2018 11:09
Where to put overridePendingTransition?
The method overridePendingTransition() should put after called startActivity[ForResult]() for enter. And then put after finish() to exit. If we put this in onCreate(), they may be a chance to mistake.
When start:
startActivityForResult(intent, ...);
overridePendingTransition(R.animator.anim_slide_left_to_right_enter, R.animator.anim_slide_left_to_right_leave);
When exit:
finish();
overridePendingTransition(R.animator.anim_slide_right_to_left_enter, R.animator.anim_slide_right_to_left_leave);
@dustin-graham
dustin-graham / ApiService.java
Created February 15, 2015 06:17
Infinite Scrolling Android RecyclerView with RxJava
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) {
return Observable.create(new Observable.OnSubscribe<List<String>>() {
@Override
public void call(final Subscriber<? super List<String>> subscriber) {
onNextObservable.subscribe(new Observer<Void>() {
int latestPage = -1;
@Override
public void onCompleted() {
subscriber.onCompleted();
@vuhung3990
vuhung3990 / complex device id
Last active November 12, 2018 01:34
get unique device id android
/**
* get unique device id, reuire permission READ_PHONE_STATE
*
* @param context
* @return unique id string
*/
public static String getDeviceId(Context context) {
String deviceID = null;
// TODO: check from pref if null -> generate
@mlvea
mlvea / currencies.json
Created March 17, 2015 16:07
Common currencies as an array
[
{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@swichers
swichers / composer.json
Last active March 24, 2022 10:58
Capturing STDERR from interactive proc_open call
{
"name": "swichers/passthru_with_errors",
"description": "An enhanced passthru() command that includes error capturing.",
"license": "Apache-2.0",
"authors": [ { "name": "Steven Wichers", "role": "Developer" } ],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"files": ["passthru_with_errors.php"]
@lukevers
lukevers / OTF.php
Last active October 5, 2020 22:19
Laravel 5 On The Fly Database Connections
<?php namespace App\Database;
use Config;
use DB;
class OTF {
/**
* The name of the database we're connecting to on the fly.
*