This file contains hidden or 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
git filter-branch --env-filter ' | |
WRONG_EMAIL="[email protected]" | |
NEW_NAME="NewName" | |
NEW_EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$NEW_NAME" | |
export GIT_COMMITTER_EMAIL="$NEW_EMAIL" | |
fi |
This file contains hidden or 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 git | |
import java.io.File | |
/* | |
How to use it | |
- https://raw.githubusercontent.com/erikmd/git-scripts/master/bin/git-format-patch-follow save into your | |
`/usr/local/bin/git-format-patch-follow` (not .sh suffix) & make it executable | |
- take following code | |
- update `patchesFolder`, `libNetworkSource`, `target` accordingly to your case |
This file contains hidden or 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
apply plugin: 'maven-publish' | |
task sourcesJar(type: Jar) { | |
from android.sourceSets.main.java.srcDirs | |
classifier = 'sources' | |
group = 'publishing' | |
} | |
publishing { | |
publications { |
This file contains hidden or 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
#!/bin/bash | |
hash adb &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo "adb not found, please contact your favourite android dev for help" | |
exit 1 | |
fi | |
if [ -z ${HOME} ]; then | |
echo "HOME env var not set, please contact your favourite android dev for help" | |
exit 1 |
This file contains hidden or 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
Here are the IntelliJ IDEA settings I use to generate the .h file: (This applies to IDEA version 12.1.6, probably similar in other versions) | |
File->Settings->External Tools | |
Click the + button for the "Edit Tool" dialog | |
The following are the form name/value pairs I used: | |
Name: javah | |
Group: Java | |
Description: Java Native Interface C Header and Stub File Generator | |
Options: Check All | |
Show in: Check All |
This file contains hidden or 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
<HTML> | |
<HEAD> | |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> | |
<STYLE TYPE="text/css"> | |
<!-- | |
@font-face { | |
font-family: "Gotham-medium"; | |
src: url('file:///android_asset/fonts/Gotham-Medium.ttf'); | |
} |
This file contains hidden or 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
Function XVLookup(value As Range, dataSet As Range, returnCol As Integer, Optional indexValue As Integer = 0) As Variant | |
Dim val As String | |
Dim found As Integer | |
val = value.Cells | |
For counter = 1 To dataSet.Rows.Count | |
Dim cellval As String | |
cellval = dataSet.Cells(counter, 1) | |
If cellval = val Then |
This file contains hidden or 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
task generateVClass << { | |
android.applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def sep = System.getProperty("file.separator") | |
def rFileTemplate = "%s/generated/source/r/%s/%s/R.java".replace("/", sep) | |
def rFile = new File(String.format(rFileTemplate, project.buildDir, output.dirName.replace("/", sep), variant.applicationId.replace(".", sep))) | |
if (!rFile.exists()) {//clean, error or variant which is not currently building | |
return | |
} | |
println("Parsing:" + rFile.absolutePath) |
This file contains hidden or 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
public static void main(String[] args) throws IOException { | |
String hostname = "api.github.com"; | |
//run with random key, error says pin hashes | |
//or | |
/* | |
openssl s_client -connect api.github.com:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 | |
output: | |
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.6) | |
project(SampleProject) | |
#enable C++ 11 | |
set(CMAKE_CXX_STANDARD 11) | |
#seems like include libgcc library (didn't work everytime) | |
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") | |
#header file location | |
include_directories("c:\\Temp\\header") |