Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Shamaru Primera shamaru001

🏠
Working from home
View GitHub Profile
@shamaru001
shamaru001 / difference.js
Created Mar 7, 2020 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
View difference.js
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@shamaru001
shamaru001 / Dockerfile_NodeJs
Last active Sep 12, 2019 — forked from oktavianidewi/dockerize-simple-api.md
Dockerize simple API from Node-JS
View Dockerfile_NodeJs
FROM node:9-slim
# use this directory to store files, run npm, and launch our app
WORKDIR /app
# copy application to /app directory, install dependecies.
# If you add the package.json first and run npm install later, Docker won't have to install the dependencies again if you change package.json
COPY package.json /app
RUN npm install
COPY . /app
@shamaru001
shamaru001 / Dockerfile_for_development_flask
Last active Sep 12, 2019
Dockerfile for development on flask
View Dockerfile_for_development_flask
FROM python:3.7.1-slim-stretch
WORKDIR /usr/app/
COPY requirements.txt .
RUN pip install -r requirements.txt
ENTRYPOINT flask run -h 0.0.0.0 -p 5000
#MOUNT_POINTS
@shamaru001
shamaru001 / reactjs_fibonnacci.jsx
Last active Mar 21, 2019
Example Component made on ReactJs. this component make a Fibonacci sequence.
View reactjs_fibonnacci.jsx
import ReactDOM from 'react-dom';
import React, { Component } from 'react';
// Example code to reproduce the fibonnacci sequence
// By: Shamaru Primera <shamaru001@gmail.com>
class App extends Component {
constructor(props){
super(props)
this.state = {
@shamaru001
shamaru001 / docker-compose.yml
Last active Mar 1, 2019 — forked from pantsel/docker-compose.yml
example docker-compose.yml for kong, postgres and konga
View docker-compose.yml
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@shamaru001
shamaru001 / setup-elementary.sh
Created Oct 20, 2017 — forked from IronistM/setup-elementary.sh
Things to do after installing elementary OS Loki 0.4
View setup-elementary.sh
#Start with a dist upgrade
sudo apt dist-upgrade
# Get chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome*.deb
sudo apt-get install -f
# dev (php, docker, git, node, bower, electron, composer)
sudo apt install -y \