Skip to content

Instantly share code, notes, and snippets.

View dstockto's full-sized avatar
💭
Learning Go and Rust

David Stockton dstockto

💭
Learning Go and Rust
View GitHub Profile
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@bradwilson
bradwilson / gist:4215933
Last active August 17, 2020 16:46
.gitconfig
[user]
name = Brad Wilson
email = dotnetguy@gmail.com
[alias]
a = add -A
abort = rebase --abort
amend = commit --amend -C HEAD
bl = blame -w -M -C
br = branch
cat = cat-file -t
@bobuss
bobuss / Calisthenics.md
Last active March 31, 2024 09:41
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active May 23, 2022 12:28
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser

Extending Z-Ray

This is a guide aimed at providing some details on Z-ray extensibility API, and some methodologies/examples on how to write extensions.

Disclaimer: This an early DRAFT, information might be outdated by the time it is being read, or might just be plain wrong. At the time of writing there is no official documentation yet, so this is aimed at filling the blanks.

#Files

Extensions reside in zend-install-path/var/zray/extensions/

@coderabbi
coderabbi / gist:cdfc0b59fe381f55aef8
Last active August 29, 2015 14:10
Peer Code Review
Let's start simple.
Add your name, contact info (twitter) and a line or two describing where you're holding and what you're looking to get out of a pairing in the comments below.
If you make a connection, come back and remove your comment.
Over the course of a week (max) pledge each other one hour of code review.
Throw some code in a gist or a repo, invite your partner and see what happens.
@ryanve
ryanve / .gitconfig
Last active May 11, 2022 09:17
git aliases
[alias]
co = checkout
ci = commit
ca = commit --amend
cia = commit -a
can = commit --amend --no-edit
com = checkout master
st = status
s = status --short
b = branch
@jmikola
jmikola / PedantryTest.php
Created March 18, 2015 21:47
Pedantic tests that have nothing to do with functional correctness
<?php
namespace MongoDB\Tests;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use ReflectionClass;
use ReflectionMethod;
use RegexIterator;