This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSL Certificate error: | |
- To permanently accept a specific certificate | |
1. Initial clone | |
- GIT_SSL_CAINFO=/path/to/cert.pem git clone https://repo.or.cz/org-mode.git | |
2. Ensure all future interactions with origin remote also work | |
- cd my-repo-directory | |
- git config http.sslCAInfo /etc/ssl/certs/rorcz_root_cert.pem | |
- To disable TLS/SSL verification for a single git command | |
git -c http.sslVerify=false clone https://domain.com/path/to/git | |
- To disable SSL verification for that singular repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iranfmcg.dokan.customer.helper; | |
import android.os.AsyncTask; | |
import android.support.annotation.MainThread; | |
import android.support.annotation.WorkerThread; | |
/* Copyright (C) Farzad Tabashir <ftabashir@gmail.com> 15 February 2017, 8:38 AM | |
* All Rights Reserved | |
*/ | |
public abstract class SafeAsyncTask<Params, Progress, Result> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def subModify(subtitleStr): | |
modified = [] | |
words = subtitleStr.split() | |
insertIndex = -1 | |
curIsEn = False | |
preIsEn = False | |
for word in words: | |
preIsEn = curIsEn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROBLEM: Could not find tools.jar. Please check that C:\Program Files\Java\Jre8" is a valid JDK install | |
SOLUTION: I just added a gradle.properties file with the following content: | |
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_45 | |
PROBLEM: 'build\intermediates\res\resources-release-stripped.ap_' specified for property 'resourceFile' does not exist | |
SOLUTION: shrinkResources works only if there is minifyEnabled set to true | |
PROBLEM: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aapt.exe dump badging %1 | findstr versionName | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker pull node:8.12-alpine | |
docker image ls | |
docker image rm | |
docker run --name <container-name> node:8.12-alpine | |
docker ps -a | |
docker rm <container-name> | |
docker run -it --name dnode node:8.12-alpine sh | |
docker start dnode | |
docker stop dnode | |
docker restart dnode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Using ES6's Proxy for safe Object property access | |
This gist is inspired from: | |
https://gidi.io/2016/02/07/using-es6-s-proxy-for-safe-object-property-access.html | |
*/ | |
const isObject = (obj: any) => obj && typeof obj === "object"; | |
const hasKey = (obj: any, key: string | number | symbol) => key in obj; | |
const UndefinedObj: ProxyHandler<{}> = new Proxy( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gives you details on the installed version of Docker | |
docker version | |
#runs a container from the image (if it has not a copy of the image in its cache, will download it beforehand) | |
docker container run hello-world | |
#getting a list of running containers | |
docker container ls | |
#getting a list of all containers | |
docker container ls --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example of running this file: python play_mp3.py path/to/root/mp3/directory 45 | |
# 45 in above example is number of files to play (optional) | |
import os,random,time,sys,subprocess,threading | |
def getFiles(path, extension, recursive=True): | |
files = [] | |
directories = [] | |
for path,directory,element in os.walk(path,False): | |
if recursive: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Scope | |
@Retention(AnnotationRetention.RUNTIME) | |
annotation class ActivityScope |
OlderNewer