Skip to content

Instantly share code, notes, and snippets.

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

Stan SARR StanSarr

🏠
Working from home
View GitHub Profile
@StanSarr
StanSarr / pre-commit-master-or-release-branch
Created October 2, 2017 14:20
Avoid commit on Release Branch or master branch
#!/usr/bin/env bash
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $branch == master ]] || [[ $branch == release-* ]];
then
echo "Sorry dude you cannot commit on master/release branch"
exit 1
fi
@StanSarr
StanSarr / NodeServerHapi.js
Created August 24, 2017 01:15
Node Server with Hapi.JS
'use strict';
// Import du framework Hapi
const Hapi = require('hapi');
// Definition des parametres du serveur Host et Port
const SERVER_ADDR = 'localhost';
const PORT = 1234;
var messages = [];
//Création du serveur
@StanSarr
StanSarr / NodeServerExpress.js
Created August 23, 2017 23:47
Node server Express Sample
//Import du module
const express = require('express');
//Module NodeJs (middleware) qui permet de parser nos requetes
const bodyParser = require('body-parser');
// Initialisation du module
let app = express();
let messages = [];
//middleware pour parser les requetes
@StanSarr
StanSarr / FirstNodeServerHttp.js
Last active August 18, 2017 15:58
Premier Serveur nodejs avec le module Http
// Chargement du module http
const http = require('http');
// Definition du port d'écoute
const port = 3000;
/*
Création du serveur (createServer)
Fonction qui gère les requetes
*/
const server = http.createServer((req, res) => {
@StanSarr
StanSarr / Parse-Package.json
Last active August 3, 2017 10:17
Parse-Server and Parse-Dashboard
{
"name": "ParseServer",
"version": "1.0.0",
"description": "Parse server for IOS - Web - Android APP ",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test yet \"",
"start": "nodemon"
},
"repository": "https://github.com/StanSarr/parse-server.git",
@StanSarr
StanSarr / Parse-server_Parse-dashboard.js
Last active August 3, 2017 10:01
Parse-server and Parse-dashboard
/**
* Created by StanSARR on 01/02/2017.
*
*/
'use strict';
const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const path = require('path');
const ParseDashboard = require("parse-dashboard");
@StanSarr
StanSarr / flightplan-deploy.md
Created March 16, 2017 11:20 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@StanSarr
StanSarr / Appfile
Created January 19, 2017 01:39 — forked from mmazzarolo/Appfile
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package