Skip to content

Instantly share code, notes, and snippets.

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

Daniele Esposito espositodaniele

🏠
Working from home
  • Napoli
View GitHub Profile
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@espositodaniele
espositodaniele / slugify.js
Created November 8, 2018 11:15 — 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
}
@espositodaniele
espositodaniele / magic_square.c
Last active June 2, 2018 10:00
C program to check if the generated matrix is a magic squadre
#include <stdio.h>
#include <time.h> /* for time() */
#include <stdlib.h> /* for rand() and srand() */
int check_square(int square[][100], int );
void generate(int matrix[][100], int );
int main() {
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > 50) {
$(".menu-bar").addClass("menu-bar-scroll");
} else {
$(".menu-bar").removeClass("menu-bar-scroll");
}
});
(function(){