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 / 0_reuse_code.js
Created July 25, 2014 21:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mrkpatchaa
mrkpatchaa / timemachinebackupx10.sh
Created October 21, 2019 07:31
TImeMachine Backup x10
// Before backup
sudo sysctl debug.lowpri_throttle_enabled=0
// After backup
sudo sysctl debug.lowpri_throttle_enabled=1
// From https://korben.info/comment-accelerer-jusqua-10x-la-sauvegarde-time-machine.html
import React from 'react'
import styled from 'styled-components'
class ScrollingWrapper extends React.Component {
state = { hasScrolled: false }
componentDidMount() {
this.scrollingWrapper.addEventListener('scroll', this.onScroll)
}
@mrkpatchaa
mrkpatchaa / optimise-images-terminal.md
Created February 20, 2019 18:26 — forked from gielcobben/optimise-images-terminal.md
Optimise your pngs from the terminal in OSX

JPG:
$ brew install jpegoptim
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

- PNG:
$ brew install optipng
$ find . -name "*.png" -exec optipng -o7 {} \;

import React from 'react';
import {
StyleSheet,
View,
TextInput,
AppRegistry,
} from 'react-native';
class App extends React.Component {
constructor(props) {
@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() {
@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.
---
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);