Skip to content

Instantly share code, notes, and snippets.

@mrico
mrico / campaignkit-auth0-actions.js
Created Apr 20, 2022
Email Address Validation for Auth0
View campaignkit-auth0-actions.js
const fetch = require('node-fetch');
/**
* Validate the given email address using CampaignKit.cc
*/
const validateEmail = async (event) => {
const token = event.secrets.TOKEN;
const { user: { email } } = event;
const body = {
emails: [email],
View UserCollection.js
define([
'CollectionExtend',
'underscore',
'backbone',
'models/UserModel'
], function (Collection, _, Backbone, UserModel) {
'use strict';
Collection.namespace = 'users';
View changelog.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'set'
require 'net/http'
require "net/https"
require 'json'
require 'pathname'
config_file = "#{ENV['HOME']}/.changelog"
View gist:1835942
15:02:51.783 [http-8080-2] INFO io.leon.unitofwork.UOWManager - Starting new unit of work for thread [Thread[http-8080-2,5,main]] with context [org.apache.catalina.connector.RequestFacade@ffce2f2].
15:02:52.032 [http-8080-2] DEBUG i.l.w.r.ExposedUrlCheckFilter - Requested exposed URL /leon/comet/connect
15:02:52.406 [http-8080-2] ERROR org.atmosphere.cpr.AtmosphereServlet - AtmosphereServlet exception
java.lang.IllegalStateException: !(Jetty || Servlet 3.0 || ContinuationFilter)
at org.eclipse.jetty.continuation.ContinuationSupport.getContinuation(ContinuationSupport.java:145) ~[jetty-continuation-7.0.2.v20100331.jar:7.0.2.v20100331]
at org.atmosphere.container.Jetty7CometSupport.service(Jetty7CometSupport.java:78) ~[atmosphere-runtime-0.7.1.jar:0.7.1]
at org.atmosphere.container.Jetty8WebSocketSupport.service(Jetty8WebSocketSupport.java:72) ~[atmosphere-runtime-0.7.1.jar:0.7.1]
at org.atmosphere.cpr.AtmosphereServlet.doCometSupport(AtmosphereServlet.java:1185) [atmosphere-runtime-0.7.1.jar:0.7.1]
at or
@mrico
mrico / enumfield_question.scala
Created Dec 27, 2010
Question about Record's EnumField and Enumeration types
View enumfield_question.scala
import net.liftweb._
import record._
import record.field._
object State extends State
sealed abstract class State extends Enumeration("created", "destroyed") {
type State = Value
val Created, Destroyed = Value
}
@mrico
mrico / GridFSHelper.scala
Created Oct 29, 2010
Helper for streaming MongoDB GridFS files in lift web applications.
View GridFSHelper.scala
package code.lib
import net.liftweb._
import http._
import util._
import Helpers._
import common._
import mongodb._
import com.mongodb._
@mrico
mrico / roller_wxr_exporter.scala
Created Oct 16, 2010
Basic script to import comments from a Apache Roller site to disqus.com.
View roller_wxr_exporter.scala
#!/bin/sh
exec scala "$0" "$@"
!#
/*
Basic script to import comments from a Apache Roller site to disqus.com.
The script reads the entries and comments rss feeds from the roller website and generates a simple wxr file
that can be imported by disqus.com.
usage: roller_wxr_exporter.scala http://your_domain.com/your_blog