Skip to content

Instantly share code, notes, and snippets.

@rca
rca / mongrel.rb
Created February 14, 2011 22:16 — forked from metaskills/mongrel.rb
if ['2.3.8', '2.3.9', '2.3.10', '2.3.11'].include?(Rails.version) && Gem.available?('mongrel', '~>1.1.5') && self.class.const_defined?(:Mongrel)
# Pulled right from latest rack. Old looked like this in 1.1.0 version.
#
# def [](k)
# super(@names[k] ||= @names[k.downcase])
# end
#
module Rack
module Utils
@wvpv
wvpv / SFMC-SSJS-delete-rows-from-DE.js
Created March 21, 2016 14:44
SFMC SSJS Delete Rows from a Data Extension
<script runat="server">
Platform.Load("core", "1.1.1");
function pruneRows () {
var DERowKeys = DataExtension.Init("DEofRowKeys");
var DERowKeyRows = DERowKeys.Rows.Lookup(["ProcessedFlag"], [0], 50, "RowDate");
var returnString = "";
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
@cebe
cebe / phpmailer.sh
Last active December 28, 2016 12:38
command for finding vulnerable files and line of code for https://isc.sans.edu/forums/diary/Critical+security+update+PHPMailer+5218+CVE201610033/21855/ finds also really old versions, e.g. 2.0.4.
#!/bin/bash
for file in $(find /var/www |grep class.phpmailer.php) ; do echo $file; grep -ni '%s["'\''], $this->Sender' $file ; done
@andyshinn
andyshinn / Dockerfile
Last active August 8, 2023 08:39
Postal on Docker
FROM ruby:2.3-onbuild
VOLUME /opt/postal/config
ENV LOG_TO_STDOUT 1
ENV AM_CONFIG_ROOT /opt/postal/config
RUN gem install procodile
RUN apt-get update -qq && apt-get install -yqq nodejs
@troyharvey
troyharvey / .gitlab-ci.yml
Last active January 8, 2024 00:38
Deploy Google Cloud Functions: GitLab CI/CD Pipeline Config File
# Update Jan 2024
# Deploying Cloud Functions is much simpler than it was 6 years ago.
# I'm leaving the gist in it's original 2018 state for now,
# but skip the the recent comments below for a simpler solution.
variables:
GCP_ZONE: us-central1-a
stages:
- npm-install
@nedimdragic
nedimdragic / oneTrustIntegrartion.js
Created May 28, 2019 07:06
Tealium Consent Manager - OneTrust Cookie Consent Manager Integration
;(function(u){
var addListener = function(element, event, callback) {
if(element.addEventListener) {
element.addEventListener(event, callback, false);
}
else if(element.attachEvent) {
element.attachEvent('on' + event, callback);
}
};
var readDataAndSetConsentPref = function(data){
<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>
%%[
set @email = emailaddr
if (@email != "") then
set @rows = LookupRows("LeadDataExtension","Email", @email)
set @rowCount = rowcount(@rows)
@jv-k
jv-k / bump-version.sh
Last active January 15, 2024 02:49
This script automates bumping the git software project's version using automation ⚠️ For an updated version, please see https://github.com/jv-k/ver-bump — a CLI module you can use with your projects ⚠️
#!/bin/bash
#
# █▄▄ █░█ █▀▄▀█ █▀█ ▄▄ █░█ █▀▀ █▀█ █▀ █ █▀█ █▄░█
# █▄█ █▄█ █░▀░█ █▀▀ ░░ ▀▄▀ ██▄ █▀▄ ▄█ █ █▄█ █░▀█
#
# Description:
# - This script automates bumping the git software project's version using automation.
# - It does several things that are typically required for releasing a Git repository, like git tagging,
# automatic updating of CHANGELOG.md, and incrementing the version number in various JSON files.