Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
@dgoguerra
dgoguerra / p4merge-git-tool.md
Last active July 6, 2024 08:51
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@anvaka
anvaka / 00.Intro.md
Last active July 4, 2024 09:20
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@Teino1978-Corp
Teino1978-Corp / 0-STATE-RUN-SALT-API-GITHUB-HOOK-USE-CASE.md
Created October 3, 2015 00:09 — forked from renoirb/0-STATE-RUN-SALT-API-GITHUB-HOOK-USE-CASE.md
State runner on salt-api POST from GitHub push hook

Validate and run a state when a valid GitHub hook call has been received from salt-api

Idea is that we can setup salt-api to receive hook call from GitHub, and configured run stat.sls only if the request HMAC signature matche is successful.

Unfortunately most documentation says to deactivate salt-api hooks authentication (i.e. webhook_disable_auth: True) which is not a good idea.

This Gist is about finding a way to declare which state to run based on data GitHub sends on push hook. But ONLY if the request is valid.

Skeleton defines desired logic, see reactor_github_push.py below.

// IT_working.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <cstdlib>
#include <climits>
using namespace std;
class Solution {
public :