Skip to content

Instantly share code, notes, and snippets.

View OlivierJM's full-sized avatar
🇿🇲

Olivier JM Maniraho OlivierJM

🇿🇲
View GitHub Profile
@OlivierJM
OlivierJM / adb+
Created April 3, 2017 08:45 — forked from ryanamaral/adb+
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@OlivierJM
OlivierJM / mongoexport-all-collections-as-json.sh
Created September 27, 2017 09:04 — forked from thbkrkr/mongoexport-all-collections-as-json.sh
Export all MongoDB collections to JSON
#!/bin/bash
DB=$1
COLLECTIONS=$(mongo localhost:27017/$DB --quiet --eval "db.getCollectionNames()" | sed 's/,/ /g')
for collection in $COLLECTIONS; do
echo "Exporting $DB/$collection ..."
mongoexport -d newtickettoolDB -c $collection -o $collection.json
done
@OlivierJM
OlivierJM / index.html
Created March 19, 2018 16:33
Form Recipe: Conditionally disabling the button // source https://jsbin.com/zucuyup
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Form Recipe: Conditionally disabling the button</title>
<style id="jsbin-css">
* {
box-sizing: border-box;
}
@OlivierJM
OlivierJM / Syllabus.md
Created March 27, 2018 14:48
Syllabus

New ES6 Features
React
MongoDB
Meteor

This will take 5 weeks ⇒ 1month + 1 week

New ES6 Features

  • Re-Introduction to Programming Languages
  • What is ES6
  • Classes
@OlivierJM
OlivierJM / advanced-web.md
Last active April 11, 2022 05:32
Syllabus

New ES6 Features
React
MongoDB
Meteor

This will take 5 weeks ⇒ 1month + 1 week

New ES6 Features (Half a week)

  • Re-Introduction to Programming Languages
  • What is ES6
  • Classes
@OlivierJM
OlivierJM / gist:2d096363f93f8d2097f0e47c2dff126b
Created April 23, 2018 06:26 — forked from stewartduffy/gist:481f21ea4906e611d934
Regex to remove file extension from JS string.
var filenameFull = "tm_icons.png";
//Regex to remove
var filenameText = filenameFull.replace(/\.[^/.]+$/, "");
@OlivierJM
OlivierJM / HOC.js
Created July 19, 2018 09:38 — forked from Restuta/HOC.js
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {
const items = [1, 2, 3, 4, 5 ];
if(items.includes(5)){
console.log(true) // true
}
if(items.indexOf(5) > -1){
console.log(true); // true ;
}
const person = {
name: "Johnaas",
job:"dev",
siblings: 2,
friends: "loading ..",
};
const { name, ...obj } = person;
console.log(name); // Johnaas
console.log(obj);
/*
const name = "Johnaas"
const age = 35;
const city = "lusaka";
const message = "my name is "+ name + ", am " + age + "years old and I live in " + city;
console.log(message); // "my name is Johnaas, am 35years old and I live in lusaka"