Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
rockavoldy / 0-odoo-cheatsheet.md
Last active April 29, 2024 10:04
Odoo Cheatsheet
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@noprompt
noprompt / console-macros.clj
Last active December 22, 2015 05:59
ClojureScript console functions/macros
(ns clojurescript.console.macros
(:refer-clojure :exclude [time]))
(defmacro with-group [title & body]
`(do
(.group js/console ~title)
~@body
(.groupEnd js/console)))
(defmacro with-group-collpased [title & body]
@goncalopp
goncalopp / sendreceive.py
Created November 9, 2012 09:00
send and receive python objects through network with integrity and authentication
'''this module implements two functions, send() and receive(), capable
of sending arbitrary objects through the network (with pickle), with
authentication and integrity assurance'''
import socket
try:
import cPickle as pickle
except ImportError:
import pickle
import hmac
@sivel
sivel / ContentMD5-ReqDotMD5.pm
Created February 20, 2012 19:14
nginx Perl Module to Output Content-MD5 HTTP Header
# nginx Embedded Perl module for adding a Content-MD5 HTTP header
#
# This perl module, will output an MD5 of a requested file using the
# Content-MD5 HTTP header, by pulling the hex hash from a file of the
# same name with .md5 appended to the end, if it exists.
#
# Author: Matt Martz <matt@sivel.net>
# Link: https://gist.github.com/1870822#file_content_md5_req_dot_md5.pm
# License: http://www.nginx.org/LICENSE