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 / 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 {

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure that the project is building successfully
@OlivierJM
OlivierJM / introrx.md
Created December 20, 2018 17:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@OlivierJM
OlivierJM / System Design.md
Created July 8, 2019 10:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@OlivierJM
OlivierJM / directUploading.ts
Created October 13, 2020 12:31 — forked from saionaro/directUploading.ts
A direct file uploading, react native edition
//...
// some interfaces imports skipped
//...
const createDirectUploadMutation = `
mutation createDirectUploadMutation(
$filename: String!
$byteSize: Int!
$contentType: String!
) {
@OlivierJM
OlivierJM / nil_empty_blank_present_ffdierence_in_ruby
Created December 2, 2020 09:16 — forked from pythonicrubyist/nil_empty_blank_present_ffdierence_in_ruby
Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass