Skip to content

Instantly share code, notes, and snippets.

View mrkpatchaa's full-sized avatar

Médédé Raymond KPATCHAA mrkpatchaa

View GitHub Profile
@mrkpatchaa
mrkpatchaa / android_app_build.gradle
Last active November 1, 2018 13:15
React Native build number
android/app/build.gradle
import groovy.json.JsonSlurper
def getNpmVersion() {
def inputFile = new File("../package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)
return packageJson["version"]
}
/* calculated from git commits to give sequential integers */
def getGitVersion() {
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: "*"
workflow: tests
workflows:
_tests_setup:
steps:
- activate-ssh-key: {}
import java.time.Duration;
import java.util.*;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.*;
public class Winner {
private int year;
private String nationality;
private String name;
private String team;
private int lengthKm;
@mrkpatchaa
mrkpatchaa / sm-annotated.html
Created August 9, 2017 20:48 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@mrkpatchaa
mrkpatchaa / git-export-changes-between-two-commits.md
Last active September 29, 2020 03:51
[Git command to export only changed files between two commits] #git

Use case : Imagine we have just created a project with composer create-project awesone-project (currently V0.2). 2 weeks later, there is a new release (V0.3). How to update your project ? Since composer update only updates the project dependencies, it is not what we are looking for. Composer doesn't know about awesome-project since it's not in our composer.json.

After trying many git solutions, I've come to this :

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2 --diff-filter=ACMRTUXB)

This command will check for changes between the two commits and ignore deleted files.

@mrkpatchaa
mrkpatchaa / Apple dock recent files
Last active October 6, 2016 21:21
Apple dock : Display recent files, recent applications, favorites elements, ... Thanks to http://korben.info/ajoutez-acces-rapide-aux-dernieres-applications-derniers-documents-fermes-macos.html
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = {"list-type" = 1; }; "tile-type" = "recents-tile";}' && \killall Dock
@mrkpatchaa
mrkpatchaa / wp-deprecated-checker.sh
Last active August 26, 2016 19:53 — forked from jbuchbinder/wp-deprecated-checker.sh
WP deprecated function check
#!/bin/bash
#
# Wordpress Deprecated function checker
#
# Version: 0.2
#
# Author: Michiel Roos <michiel@donationbasedhosting.org>
# Jeff Buchbinder (https://github.com/jbuchbinder)
#
# www.php.net/manual/en/migration53.deprecated.php
@mrkpatchaa
mrkpatchaa / language-cookie-wpse-113662.php
Created June 9, 2016 05:26 — forked from brasofilo/language-cookie-wpse-113662.php
WordPress plugin to deal with language cookies. Create one page for each language. Then a menu with them. Configure the arguments in the plugin file. Than do your thing in your theme with $_COOKIE[cookie_name].
@mrkpatchaa
mrkpatchaa / README.md
Last active April 4, 2024 09:37
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@mrkpatchaa
mrkpatchaa / php7_build_ubuntu.sh
Created March 12, 2016 22:27 — forked from m1st0/php_build_ubuntu.sh
Compiling PHP 7 on Ubuntu 15.04 with Various Supported Modules
#! /bin/bash
## PHP 7 Initial Compile ##
## Some help from the various places like these. ##
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
## Setup Ubuntu 15.04/15.10 ##
# Other dependencies for PHP 7. Add any missing ones from configure script
# complaints, plus some LAMP needs too.