Skip to content

Instantly share code, notes, and snippets.

@ihortkachuk
ihortkachuk / postfix.md
Last active December 14, 2015 22:25
Config Postfix Mac OS X Yosemite 10.10

#Config Postfix Mac OS X Yosemite 10.10

###Step 1. Edit Postfix config file Open a terminal and edit the file main.cf:

sudo vi /etc/postfix/main.cf

First check Postfix is configured correctly, look for the following lines:

@offsky
offsky / NewMacConfig.md
Last active July 3, 2017 15:50
Setup new mac for web development (Updated for Yosemite)
@timtadh
timtadh / newegg.py
Created November 7, 2011 12:10
How to extract all of the items (name, price) from Newegg.
import itertools
import requests, lxml, lxml.html
import json
# 7603 Hard Drives
# 7611 RAM
# 6642 random store
def newegg_stores_req():
r = requests.api.get('http://www.ows.newegg.com/Stores.egg/Menus')
return [store['StoreID'] for store in json.loads(r.content)]
@kosso
kosso / background_demo.js
Created March 12, 2011 17:55
Background Service notification for Titanium
/* Kosso : March 12th 2011
This the only way I managed to do this without the app crashing on resume.
Done slightly differently to the KS example, since they unregister the service and
do not use a setInterval timer.
*/
//############ in app.js :
// test for iOS 4+
@shazow
shazow / gist:789309
Created January 21, 2011 06:08
SQLAlchemy declarative base with __export__ and __import__ useful for exporting and importing fixtures.
"""SQLAlchemy Metadata and Session object"""
from sqlalchemy import MetaData, types
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime, date
__all__ = ['Session', 'metadata', 'BaseModel']
Session = scoped_session(sessionmaker(expire_on_commit=False))
@HHammond
HHammond / Pandas Table Summary
Last active February 3, 2018 04:51
Pandas Pretty Table CSS
import numpy as np
import pandas as pd
from functools import partial
def summary(df, fn=np.sum, axis=0, name='Total',
table_class_prefix='dataframe-summary'):
"""Append a summary row or column to DataFrame.
Input:
------
@Greg-Boggs
Greg-Boggs / Php56 install homebrew mac drupal
Last active April 13, 2018 20:47 — forked from nrackleff/drupal-56-upgrade
Install Php56 with Drupal configs on Mac with Homebrew with xedebug and OPcache
Steps to update local dev environment to PHP5.6 to be ready for Drupal 8.
In a terminal window:
brew update ( you may also may need brew doctor)
brew unlink php55
brew install php56 --with-homebrew-apxs --with-apache
brew install php56-xdebug
// Mirth JS Split
var line;
var message = '';
while (line = reader.readLine()) {
message += line + '\r\n'; // 1 to N
try {
reader.mark(1); //Looks ahead
var nextline = reader.readLine();
if(nextline==null) break;
@testingbot
testingbot / python_parallel_webdriver.py
Created August 3, 2012 16:36
python parallel webdriver testing on testingbot
from threading import Thread
from selenium import webdriver
import time
API_KEY = "key"
API_SECRET = "secret"
def get_browser(caps):
return webdriver.Remote(
desired_capabilities=caps,
@dokterbob
dokterbob / README.rst
Last active August 13, 2018 00:47
Setting up a Mac system for Python.
  1. Install XCode from the App Store.
  2. Install the XCode command line tools from the 'Downloads' pane in the XCode settings.
  3. Install SublimeText.
  4. Add the following SublimeText configuration options (to User settings):

    // Set to true to insert spaces when tab is pressed
    "translate_tabs_to_spaces": true,