Skip to content

Instantly share code, notes, and snippets.

View craig-davis's full-sized avatar
👋

Craig Davis craig-davis

👋
View GitHub Profile
@mbbx6spp
mbbx6spp / README.md
Created October 8, 2011 00:21
Git hooks to enforce pull request on master workflow

Sanity checking Git Hook for pre-commit

Checks that you are trying to push to master (or other key branches) from your local repository.

Installation

Download the above raw file (edit it as you please) and place inside your Git repository under: $GITDIR/hooks/pre-commit where $GITDIR is typically .git under your project working directory. Then make sure you make it executable: chmod +x .git/hooks/pre-commit

@nyov
nyov / magento-cli.py
Last active August 15, 2021 12:57
A Magento REST API example with rauth as OAuth provider. For Magento 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from rauth.service import OAuth1Service
# Create consumer key & secret in your Magento Admin interface
# For an API Guideline see:
# http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html
#
# Short Magento setup explanation:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
stopOnFailure="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
bootstrap='vendor/autoload.php'>
<testsuites>
@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@omegahm
omegahm / create_labels.sh
Created April 7, 2015 19:00
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@svpernova09
svpernova09 / LightningTalkWishList.md
Last active May 18, 2017 14:10
NomadPHP Lightning Talks I'd love to see

NomadPHP Lightning talks

Every month I have the challenge of finding two speakers to do a 10 minute lightning talk on something PHP related (even adjacent). The past few months this has become increasingly difficult so I've created my personal wishlist. If you would like to add to this list please leave a message below. If you would like to give one of these lightning talks, please let me know by filling out our submission form: https://nomadphp.com/lightning-talk-submission/

I want to encourage new and veteran speakers. This is a great way for you to get some exposure and show conference organizers what you can do. Veterans can use Lightning Talks to test out new talk ideas or even different slide decks to see the audience reactions. Think of it as A/B testing your talks.

How do lightning Talks Work?

The best example is to check out the NomadPHP Youtube Channel and see for yourself!

@yan-foto
yan-foto / jenkins.sh
Created September 19, 2015 13:17
Vagrant shell provision to solve `No X-Jenkins-CLI2-Port` (Ubuntu guest)
#!/bin/bash
# This is a simple example of a shell script which is used as a Vagrant provision
# It can be used as: 'config.vm.provision "shell", path: "./jenkins.sh"'
# inside a Vagrantfile.
# The logic is simple and the implementation as well. Any suggestions/improvements
# are highly welcome.
# Default values
jenkins_home="/var/lib/jenkins"
@greyfairer
greyfairer / Vagrantfile
Last active October 11, 2016 22:17 — forked from aweijnitz/Vagrantfile
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
@danieleggert
danieleggert / GPG and git on macOS.md
Last active June 6, 2024 09:29
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@ankurk91
ankurk91 / github_gpg_key.md
Last active June 7, 2024 14:31
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/