Skip to content

Instantly share code, notes, and snippets.

//
//@author PhilippTheCat
//@category witcher
//@keybinding
//@menupath
//@toolbar
import ghidra.app.cmd.data.rtti.Rtti4Model;
import ghidra.app.cmd.data.rtti.VfTableModel;
import ghidra.app.util.datatype.microsoft.DataValidationOptions;
@rheinardkorf
rheinardkorf / slack-verify.php
Last active August 4, 2018 06:46
Verifying Slack Requests
<?php
/**
* Validate Slack notification signature.
*
* @see https://api.slack.com/docs/verifying-requests-from-slack
*
* @param array $headers POST headers.
* @param string $response_body JSON string of body.
* @param string $signing_secret Slack secret.
@andrewroberts
andrewroberts / convertSpreadsheetToPdf.gs
Last active September 15, 2022 17:21
Convert a multi-sheet Google Spreadsheet into a PDF, with option to email it.
/*
* Save spreadsheet as a PDF
*
* Based on Dr.Queso's answer in http://stackoverflow.com/questions/30367547/convert-all-sheets-to-pdf-with-google-apps-script/30492812#30492812
*
* @param {String} email Where to send the PDF [OPTIONAL]
* @param {String} spreadsheetId Or the active spreadsheet[OPTIONAL]
* @param {String} sheetName The tab to output [OPTIONAL]
* @param {String} PdfName [OPTIONAL]
*/
@Itach1Uchixa
Itach1Uchixa / LocalizedTreeRouteFactory.php
Last active March 17, 2020 21:02
Zend Framework 3 Localized route concept
<?php
/**
* @author Kakhramonov Javlonbek <kakjavlon@gmail.com>
* @version 1.1.2
*/
namespace Application\Factory;
use Interop\Container\ContainerInterface;
use Application\Router\LocalizedTreeRouteStack;
use Zend\Router\RouterConfigTrait;
// key = value
array_reduce($input, function ($carry, $item) {
$carry[$item['x']] = $item['y'];
return $carry;
}, []);
// key = value, from array with keys
array_reduce(array_keys($input), function($carry, $key) use ($input) {
$carry[] = $input[$key]['x'];
return $carry;
@abiusx
abiusx / stdlib.php
Last active April 17, 2017 05:10
Standard PHP Library
<?php
function grep_r($str,$find)
{
return substr($str,$r=strpos($str,$find)+strlen($find),strpos($str,PHP_EOL,$r)-1-$r);
}
function curl($url,$postparams=[],$headers=[],$additional_opts=[])
{
$opts=[
CURLOPT_COOKIEJAR => 'stdlib.cookie',
CURLOPT_COOKIEFILE => 'stdlib.cookie',
@splarty
splarty / circlepacking_tooltips.md
Last active June 8, 2017 01:20
circlePacking_tooltips_d3.js
@rakawestu
rakawestu / app.js
Created July 21, 2016 06:59
Node JS and MySQL Example With Pug Templating Engine
var express = require('express');
var mysql = require('mysql');
var app = express();
///
/// Create connection to MySQL database server.
///
function getMySQLConnection() {
return mysql.createConnection({
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@phpdave
phpdave / Get the PHP Source and prerequisite binaries, run configure and make to compile.sh
Last active April 17, 2019 01:51
DISCLAIMER Note: this is currently is a draft and is not meant to be used yet. Many things that I'm looking to clean up and simplify. There may be things that don't work so only do this on a development system that you aren't worried about it being fubar'd
#DISCLAIMER: this is currently is a draft and is not meant to be used yet. Many things that I'm looking to clean up and simplify. There may be things that don't work so only do this on a development system that you aren't worried about it being fubar'd
#Download PHP source code and change directories to the downloaded src. This is a dev version of PHP. git.php.net is official. http://www.github.com/php/php-src is mirror
git clone http://git.php.net/repository/php-src.git && cd php-src
#Alternative get a certain branch (version), the default is the master branch which is development
#git clone -b PHP-5.6.7 http://git.php.net/repository/php-src.git
#specific to litmis space not having the includes on a fresh container
#local
scp qopensys-usr-include.tar.gz usrcis42@spaces.litmis.com:~