Skip to content

Instantly share code, notes, and snippets.

View ivansabik's full-sized avatar

Iván ivansabik

  • Americas
View GitHub Profile
@scottjacobsen
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created December 14, 2012 00:07
Git clone using ssh agent forwarding and sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
@brikis98
brikis98 / Average page views by industry
Created November 2, 2011 03:57
Apache Pig Script Example
pv_by_industry = GROUP profile_view by viewee_industry_id
pv_avg_by_industry = FOREACH pv_by_industry
GENERATE group as viewee_industry_id, AVG(profie_view) AS average_pv;
@anderser
anderser / sheet.py
Created October 10, 2011 21:02
Merge multiple excel sheets in one workbook into single sheet workbook
#!/usr/bin/python
# -*- coding: utf-8 -*-
import xlrd
import xlwt
from optparse import OptionParser
import datetime
"""
Merges excel files with multiple sheets with identical header lines into
@burnto
burnto / gist:1202437
Created September 8, 2011 02:09
Authorize.net reasons
"""
From http://www.authorize.net/support/merchant/Transaction_Response/Response_Reason_Codes_and_Response_Reason_Text.htm
"""
REASONS = [
# resp code, reason code, reason text, notes
[1, 1, "This transaction has been approved."],
[2, 2, "This transaction has been declined."],
[2, 3, "This transaction has been declined."],
[2, 4, "This transaction has been declined.", "The code returned from the processor indicating that the card used needs to be picked up."],
@jarus
jarus / test.py
Created August 21, 2011 14:52
Testing Flask application with basic authentication
import base64
from myapplication import app
class MyTestCase(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
def tearDown(self):
pass