Skip to content

Instantly share code, notes, and snippets.

View jamalhassouni's full-sized avatar
🎯
Focusing

jamal hassouni jamalhassouni

🎯
Focusing
View GitHub Profile
@jamalhassouni
jamalhassouni / postgres-brew.md
Created August 16, 2020 10:53 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
<?php
define('DS', DIRECTORY_SEPARATOR); //
// privileges/verifying_session/check_session
// /opt/lamp/htDocs/folder name
//define('Save_Path', __DIR__ . DS . '../session');
define('Save_Path',dirname(realpath(__FILE__)).DS.'../ee399e457eae2ef36adabc2ad78d8064');
class Session extends SessionHandler
{
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
*
@jamalhassouni
jamalhassouni / fix-homebrew-npm.md
Created March 31, 2019 11:00 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@jamalhassouni
jamalhassouni / mac-osx-node-npm.md
Created March 31, 2019 11:00 — forked from edPratt/mac-osx-node-npm.md
Fixing npm On Mac OS X; When npm install -g does not work

Nuke Everything node/npm related

(If you have setup another prefix)
rm -rf .npm-global

sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf ~/.npm
brew uninstall node --ignore-dependencies node
rm -rf /usr/local/lib/node_modules

@jamalhassouni
jamalhassouni / optimizeAndCropImage.cloudFunction.js
Created March 29, 2019 19:58 — forked from mbove77/optimizeAndCropImage.cloudFunction.js
Firebase cloud function to resize and optimize image after upload in cloud storage.
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const spawn = require('child-process-promise').spawn;
const mkdirp = require('mkdirp-promise');
const path = require('path');
const os = require('os');
const fs = require('fs');
// // Create and Deploy Your First Cloud Functions
exports.optimizeImages= functions.storage.object().onFinalize((data) => {
{"lastUpload":"2019-07-24T09:33:26.834Z","extensionVersion":"v3.4.1"}