Skip to content

Instantly share code, notes, and snippets.

View beppe9000's full-sized avatar

beppe9000

View GitHub Profile
@0xjac
0xjac / private_fork.md
Last active June 5, 2024 12:55
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@mwpastore
mwpastore / 00README.md
Last active April 18, 2024 06:21
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

README

This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

@cstroe
cstroe / OpenSourceCRM.rst
Last active May 30, 2024 11:53
A distilled list of open-source CRM software
anonymous
anonymous / index.html
Created February 7, 2017 02:41
JS Bin // source http://jsbin.com/papazuquxe
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<meta charset="utf-8">
<title>JS Bin</title>
</head>
@neelabhg
neelabhg / qemu_vm_mount_windows_local_folder.sh
Created March 6, 2017 08:28
Mount a Windows host's folder on a QEMU Linux guest
#! /bin/bash
# The Windows folder needs to be shared appropriately
WINDOWS_DIR_PATH="//10.0.2.2/workdir"
MNTPOINT="/workdir_local"
if [ ! -d "$MNTPOINT" ]; then
mkdir $MNTPOINT
fi
@mlocati
mlocati / exceptions-tree.php
Created March 9, 2017 10:58
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@angel333
angel333 / youtube-playlist-duration.js
Last active August 15, 2021 19:33
Youtube playlist duration
// Just copy this into console while on a playlist page (https://www.youtube.com/playlist?list=.....)
alert(((document) => {
let seconds = Array.from(document.querySelectorAll('.pl-video-time .timestamp span'))
.map((span) => {
let time = span.textContent.split(':');
return (Number(time[0]) * 60) + Number(time[1]);
})
.reduce((a,b) => {
return a + b;
<?php
/**
* @package Kinsta_widget
* @version 1.0
*/
/*
Plugin Name: Kinsta Widget
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Your Name
@zarankumar
zarankumar / Add image to product gallery programmatically - woocommerce
Last active August 1, 2022 00:53
Add image to product gallery programmatically - woocommerce .Woocommerce manage field ‘_product_image_gallery’ with id of images separatly for comma.
@pimatco
pimatco / all-angular-material-components-imports.txt
Last active December 6, 2023 15:24
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';