Skip to content

Instantly share code, notes, and snippets.

View sbeleidy's full-sized avatar

Saad Elbeleidy sbeleidy

View GitHub Profile
@sbeleidy
sbeleidy / gulpfile.js
Created August 4, 2015 15:14
Foundation Gulpfile.js
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
sass = require('gulp-sass'),
imagemin = require('gulp-imagemin'),
plumber = require('gulp-plumber'),
browserSync = require('browser-sync'),
reload = browserSync.reload();
@sbeleidy
sbeleidy / newLara.sh
Last active December 27, 2015 12:56
Installing Laravel in remote empty repo
# For when installing laravel in an existing empty repo
# Clone and cd into repo then run the following
laravel new d
cd d
mv {.,}* ../
cd ..
rm -r d
@sbeleidy
sbeleidy / sanitize-example.js
Last active February 14, 2016 10:03
Convert arrays in an object to objects
// Complex object with arrays inside of it or its children
o = {
a: "a",
b: {
c: "c",
d: "d"
},
e: [1,2,3],
f: {
g: ["a","b","c", {
@sbeleidy
sbeleidy / gundb-blog.js
Last active February 14, 2016 09:41
gun 0.3.4 intro
// View the walkthrough at https://medium.com/@sbeleidy/a-weekend-with-gun-a61fdcb8cc5d
localStorage.clear();
var gun = Gun();
var markInfo = {
name: "Mark",
username: "@amark"
};
@sbeleidy
sbeleidy / lets-encrypt.sh
Created May 8, 2016 07:42
SSL all the things
# Let's Encrypt SSL Setup
# Following the awesome tutorial from digitalocean's community:
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04
#####
sudo apt-get -y install git bc
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
sudo apt-get install nginx
sudo nano /etc/nginx/sites-available/default
# Add to server block:
# location ~ /.well-known {
@sbeleidy
sbeleidy / reTURN.sh
Created May 8, 2016 07:46
reTURN setup
#####
# TURN Server Setup
# Requires SSL setup - see https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b
#####
sudo apt-get update
sudo apt-get install resiprocate-turn-server
nano /etc/reTurn/reTurnServer.config
# Change TurnAddress to your public IP address
@sbeleidy
sbeleidy / easyRTC.sh
Created May 8, 2016 07:49
Easy RTC setup with reTURN
#####
# Signalling Server Setup ex: EasyRTC
# See https://easyrtc.com/docs/guides/easyrtc_server_install.php
# This assumes you followed https://gist.github.com/sbeleidy/f4cd7e96dc0910dbc27cc6845d8b4d22 and
# https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b for SSL and reTURN setup
#####
# Install node
sudo apt-get install nodejs
sudo apt-get install npm
@sbeleidy
sbeleidy / index.html
Last active March 20, 2017 19:14
Foundation project package.json - inspired by https://css-tricks.com/why-npm-scripts/
<!DOCTYPE html>
<html lang="en">
<head>
<title>Foundation Project</title>
<meta charset="UTF-8">
<link href="dist/css/style.css" rel="stylesheet">
</head>
<body>
@sbeleidy
sbeleidy / FKScore.html
Created July 5, 2016 20:07
Calculate and display Flesch–Kincaid readability scores as a user types
<!DOCTYPE html>
<html lang="en">
<head>
<title>FK Readability Score</title>
<meta charset="UTF-8">
</head>
<body>
<textarea id="theText" rows="5" cols="100"></textarea>
</body>
<script>
@sbeleidy
sbeleidy / Notes.ipynb
Last active January 22, 2017 07:40
Machine Learning Nano degree Notes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.