Skip to content

Instantly share code, notes, and snippets.

View nahanil's full-sized avatar
💭
Find me by the tumtum tree

Jarrod nahanil

💭
Find me by the tumtum tree
View GitHub Profile
@jeremy-wolfe
jeremy-wolfe / update.sh
Last active March 10, 2020 13:40
ProtonMail Bridge Updater for Arch Linux
#!/bin/bash
# Should work with your favorite hash algorithm (md5sum, sha256sum, etc.)
hash=md5sum
old="$($hash PKGBUILD)"
wget -O PKGBUILD https://protonmail.com/download/beta/PKGBUILD
new="$($hash PKGBUILD)"
[ "$old" = "$new" ] && echo "Up to date." || makepkg -si
@thomasdarimont
thomasdarimont / docker-compose.yml
Created January 25, 2019 17:52
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@tboerger
tboerger / gist:4840e1b5464fc26fbb165b168be23345
Created February 17, 2017 09:37
Golang LDAP search and authentication
package main
import (
"fmt"
"strings"
"gopkg.in/ldap.v2"
)
const (
ldapServer = "ad.example.com:389"
@boynoiz
boynoiz / php7.sh
Last active September 5, 2018 16:30
PHP 7.0 on Debian 7 Wheezy
#!/bin/bash
set -e
PHP_VERSION=7.0
# Script base on php7.sh by Tom Van Looy https://gist.github.com/tvlooy/881d0d67d0ad699c38a3
# Dont use this shell script in production server unless you dont care
# You must first add the testing repository in your sourcelist before run this
# You must stop php7-fpm service if you already install
@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active March 8, 2024 18:24
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>