Skip to content

Instantly share code, notes, and snippets.

Avatar

Mo Ismailzai moismailzai

View GitHub Profile
@jonfriesen
jonfriesen / .travis.yml
Last active Mar 22, 2020 — forked from ryboe/.travis.yml
Example .travis.yml for Golang with CodeCov.io integration
View .travis.yml
language: go
# Only the last two Go releases are supported by the Go team with security
# updates. Any versions older than that should be considered deprecated.
# Don't bother testing with them. tip builds your code with the latest
# development version of Go. This can warn you that your code will break
# in the next version of Go. Don't worry! Later we declare that test runs
# are allowed to fail on Go tip.
go:
- 1.9
@w00fz
w00fz / sphp.sh
Last active Aug 31, 2020
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@gabrielelana
gabrielelana / Vagrantfile
Last active Mar 20, 2020
How to create a VirtualBox machine with encrypted storage with Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
@andrezrv
andrezrv / varnish-purge-cache.sh
Created Nov 2, 2013
Purge all Varnish cache.
View varnish-purge-cache.sh
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
@hakre
hakre / DateInterval_11556731.php
Created Jul 19, 2012
How we can add two date intervals in PHP
View DateInterval_11556731.php
<?php
/**
* How we can add two date intervals in PHP
* @link http://stackoverflow.com/q/11556731/367456
* @link http://codepad.viper-7.com/oBW2le
*
* NOTE: This code is rough.
*/
header("Content-Type: text/plain;");
You can’t perform that action at this time.