Skip to content

Instantly share code, notes, and snippets.

View Ismaaa's full-sized avatar
🎯
Focusing

Ismail D. Ismaaa

🎯
Focusing
View GitHub Profile
server {
listen 80;
server_name demo.example.com;
return 301 https://demo.example.com$request_uri;
}
server {
listen 443 ssl spdy;
server_name demo.example.com;
ssl on;
@Ismaaa
Ismaaa / slugify.js
Created March 10, 2018 23:21 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@Ismaaa
Ismaaa / SCSS.md
Created January 1, 2018 04:31 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@Ismaaa
Ismaaa / README.md
Created January 1, 2018 01:30 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@Ismaaa
Ismaaa / node-and-npm-in-30-seconds.sh
Created November 15, 2017 22:54 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Server setup for Ubuntu 16.04 on Digital Ocean

Update system

apt-get update && apt-get dist-upgrade -y
apt-get autoremove -y

Script for installing Apache, MySQL, PHP, etc

@Ismaaa
Ismaaa / ubuntu-server-setup-16.04-LAMP.md
Last active October 7, 2017 22:32 — forked from Otienoh/ubuntu-server-setup-16.04-LAMP.md
LAMP Server setup for Ubuntu 16.04 on Digital Ocean

Server setup for Ubuntu 16.04 on Digital Ocean

The setup installs the following software:

The setup installs the following software:

  • Apache
  • MySQL
  • PHP
  • Node
@Ismaaa
Ismaaa / UbuntuSwapfile.txt
Last active May 26, 2017 02:43 — forked from BobRupholdt/UbuntuSwapfile.txt
Fitxer SWAP per a un DigitalOcean (Ubuntu 16.04 - LAMP droplet) per a que el npm i pugui funcionar correctament
# comprovem el swapfile
sudo swapon -s
# si no hi ha cap
# swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k
sudo mkswap /swapfile
sudo swapon /swapfile
# ara hauria de mostrar el swapfile amb:
swapon -s
# config final