Skip to content

Instantly share code, notes, and snippets.

View shamaru001's full-sized avatar
🏠
Working from home

Shamaru Primera shamaru001

🏠
Working from home
View GitHub Profile
@shamaru001
shamaru001 / difference.js
Created March 7, 2020 06:22 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* 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 September 12, 2019 21:11 — forked from oktavianidewi/dockerize-simple-api.md
Dockerize simple API from Node-JS
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 September 12, 2019 21:03
Dockerfile for development on 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 March 21, 2019 22:09
Example Component made on ReactJs. this component make a Fibonacci sequence.
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 March 1, 2019 10:24 — forked from pantsel/docker-compose.yml
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@shamaru001
shamaru001 / setup-elementary.sh
Created October 20, 2017 16:52 — forked from IronistM/setup-elementary.sh
Things to do after installing elementary OS Loki 0.4
#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 \