Skip to content

Instantly share code, notes, and snippets.

View harryadel's full-sized avatar

Harry Adel harryadel

View GitHub Profile
@harryadel
harryadel / .eslintignore
Created September 2, 2021 14:36
Example Meteor Eslint and Prettier config files
.meteor
.tmp
node_modules/
.build
packages/
https://github.com/googlesamples/assistant-sdk-python/issues/236#issuecomment-383039470
You are trying to install the package to a system folder which you don't have permissions to write to.
You have three options(use only one of them):
1-setup a virtual env to install the package (recommended):
python3 -m venv env
source ./env/bin/activate
python -m pip install google-assistant-sdk[samples]
@harryadel
harryadel / example
Created September 30, 2019 16:00
Meteor Blaze Shopping Cart Example
// Rendered DOM
// example.html
<div class="product">
<img src="{{productImageSource}}" />
<h4>Title</h4>
<p>Price {{productPrice}}</p>
<button class="add">+</button>
<input type="number" id="quantity" />
<button class="subtract">-</button>
<span class="subtotal">Subtotal</span>
@harryadel
harryadel / command.sh
Last active May 28, 2019 13:04
docker-compose mongodb dump command
docker run --rm --net ${network_name} --link ${container_name}:mongo -v $(pwd)/mongo-dump:/dump mongo bash -c 'mongodump --db xxxx -u xxxxx -p xxxxx --host ${container_name}'
# example
docker run --rm --net payslips_network --link pays_testing_database:mongo -v $(pwd)/mongo-dump:/dump mongo bash -c 'mongodump --db hrvj_db -u hrvj_user -p jd2jggPFCY4xuEuC --host pays_testing_database'
@harryadel
harryadel / client.js
Created November 29, 2018 16:12
Meteor Methods
Meteor.call('sendName', 'John', (err, res) => {
if (err) {
return Bert.alert(err.reason, 'danger')
}
return Bert.alert('Name sent successfully!', 'success')
})
@harryadel
harryadel / package.json
Created November 4, 2018 17:49
Loopback-playground
{
"name": "loopback-playground",
"version": "1.0.0",
"main": "server/server.js",
"engines": {
"node": ">=4"
},
"scripts": {
"lint": "eslint .",
"start": "node .",
/*
My answer for exercise 'Flattening'
in Eloquent JavaScript Second Edition
Chapter 5 Higher-Order Functions
*/
console.log([].concat.apply([], arrays));
/*
My answer for exercise 'Deep comparison'
in Eloquent JavaScript Second Edition
Chapter 4 Data Structures: Objects and Arrays
*/
function deepEqual(o1, o2) {
if(JSON.stringify(o1) === JSON.stringify(o2)) {
return true;
/*
My answer for exercise 'Reversing an array'
in Eloquent JavaScript Second Edition
Chapter 4 Data Structures: Objects and Arrays
*/
function reverseArray(array) {
var output = [];
/*
My answer for exercise 'The sum of a range'
in Eloquent JavaScript Second Edition
Chapter 4 Data Structures: Objects and Arrays
*/
function range(first, second, third) {
var array = [];
if (first < second) {
while (first <= second ) {