Skip to content

Instantly share code, notes, and snippets.

View denisjacquemin's full-sized avatar
🎯
Focusing

Denis Jacquemin denisjacquemin

🎯
Focusing
View GitHub Profile
@jferris
jferris / configmap.yaml
Last active October 28, 2024 01:42
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
@bzkdjc
bzkdjc / couch.js
Last active July 28, 2021 17:51 — forked from auggernaut/couch.js
Creating a per-user Database in CouchDB with nano.
exports.findOrCreateDB = function (config, creds, cb) {
let nano = require('nano')(`http://${config.couch_admin}:${config.couch_password}@${config.couch_host}:${config.couch_port}`),
users = nano.use('_users'),
userDB = nano.use(creds.username),
log = console.log.bind(console, "[DEBUG]"),
user = {
_id : "org.couchdb.user:" + creds.username,
name : creds.username,
@CodingDoug
CodingDoug / README.md
Last active November 6, 2022 09:29
Example code from the video "Use async/await with TypeScript in Cloud Functions"

Example code from the video "Use async/await with TypeScript in Cloud Functions"

This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.

Watch the video here

The code in this project is licensed under the Apache License 2.0.

Copyright 2018 Google LLC
require 'date'
class FirebasePush
PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
def initialize
@prev_ts = 0
@rand_chars = Array.new(12)
end
@raddeus
raddeus / app.js
Last active February 4, 2025 09:42
Basic Express 4.0 Setup with connect-flash
var express = require('express');
var session = require('express-session');
var cookieParser = require('cookie-parser');
var flash = require('connect-flash');
var app = express();
app.use(cookieParser('secret'));
app.use(session({cookie: { maxAge: 60000 }}));
app.use(flash());
@victorb
victorb / app.js
Created September 24, 2013 16:37
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};
@auggernaut
auggernaut / couch.js
Last active August 23, 2021 16:47
Creating a per-user Database in CouchDB with nano.
exports.findOrCreateDB = function (config, creds, cb) {
var nano = require('nano')("http://" + config.couch_admin + ":" + config.couch_password + "@" + config.couch_host + ':' + config.couch_port);
var users = nano.use('_users');
var user = {
_id: "org.couchdb.user:" + creds.username,
name: creds.username,
roles: [],
type: "user",
@harlanbarnes
harlanbarnes / agent.conf
Created March 28, 2012 17:31
XML filter for Logstash
input {
stdin {
debug => true
type => default
add_field => [ "xml", "%{@message}" ]
}
}
filter {
xml {
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
require "pdf/reader"
class PageTextReceiver
attr_accessor :content
# Called when page parsing starts
def end_page(arg = nil)
if @content
puts @content
@content = nil