Skip to content

Instantly share code, notes, and snippets.

View davetrux's full-sized avatar

David Truxall davetrux

View GitHub Profile
@kristofferh
kristofferh / git-export
Created December 7, 2011 13:01
"Export" a git repository to zip file
git archive --format zip --output /full/path/to/zipfile.zip master
@ran488
ran488 / build.gradle
Created April 25, 2014 13:59
Running Fortify from Gradle build. These are the snippets of code you can add to your build.gradle to run the analyzer and spit out a Fortify *.fpr file. Fortify is not F/OSS, so you (your company) will need a license, so the dependencies won't be out in public repo's. You will have to add it to your company's private repo (e.g. Artifactory).
// Add a new configuration
configurations {
fortify { extendsFrom compile }
}
// pull in the fortify libs for the new configuration
dependencies {
fortify 'com.fortify:sourceanalyzer:3.90'
}
@ZkHaider
ZkHaider / expand-collapse.java
Last active January 30, 2022 02:31
Simple Expand / Collapse RecyclerView Item
public static class ExampleViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
private int originalHeight = 0;
private boolean isViewExpanded = false;
private YourCustomView yourCustomView
public ExampleViewHolder(View v) {
super(v);
v.setOnClickListener(this);
@PrashamTrivedi
PrashamTrivedi / publish.gradle
Created August 27, 2015 07:24
Gradle file for copying release ready apk to desired directory.
def getReleasePath() {
//Define RELEASE_PATH anywhere(in properties file) and your apk + mapping file will be copied there.
return hasProperty('RELEASE_PATH') ? RELEASE_PATH : "${project.rootDir}\\Release"
}
android.applicationVariants.all { variant ->
//Mapping file for proguard path for each variant
def mappingFile = variant.variantData.mappingFile
@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jherax
jherax / sortBy.js
Last active May 31, 2021 07:50
Sorts an array with multiple ordering criteria (Schwartzian transform)
/**
* Sorts an array and allows multiple sorting criteria.
*
* It applies the Schwartzian transform:
* https://en.wikipedia.org/wiki/Schwartzian_transform
*
* Author: David Rivera
* Github: https://github.com/jherax
*
* You can fork this project on github:
@ziadoz
ziadoz / install.sh
Last active April 7, 2024 16:04
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@dianjuar
dianjuar / Install update WordPress puglins directly.md
Last active April 16, 2024 12:21
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Put this on your wp-config.php

/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');
@minsik-ai
minsik-ai / Jetbrains IDE Essential Shortcuts.md
Last active February 18, 2021 04:50
Essential Shortcuts for Jetbrains IDEs, including IntelliJ IDEA, Android Studio & others.

Jetbrains IDE Essential Shortcuts

This is a list of Jetbrains IDE shortcuts I use everyday.

Comments welcome! Tell me your favorites.

Navigating Between Windows

Change Focus to Window

@AngeloAnolin
AngeloAnolin / web.config
Created March 11, 2017 02:56
Web Configuration for Vue Applications Hosted in IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />