Skip to content

Instantly share code, notes, and snippets.

View avilaton's full-sized avatar

Gastón Avila avilaton

View GitHub Profile
@erikbern
erikbern / use_pfx_with_requests.py
Last active December 23, 2025 13:58
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@michaelcox
michaelcox / SpecRunner.js
Last active October 12, 2024 17:11
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
@alexeygolev
alexeygolev / gist:3785312
Created September 26, 2012 00:38 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@namsral
namsral / zippy.html
Created February 3, 2012 09:58
Zippy example from the Angular.js talk at HTML5 Dev Conf
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<meta charset="UTF-8" />
<script src="http://code.angularjs.org/angular-0.9.19.min.js" ng:autobind></script>
<body>
<zippy class="open">
<header>Greeting</header>
<pane>Hello World!</pane>
</zippy>