Skip to content

Instantly share code, notes, and snippets.

View stefanfoulis's full-sized avatar

Stefan Foulis stefanfoulis

View GitHub Profile
@cavinsmith
cavinsmith / nvidia.md
Last active January 23, 2024 19:30
Nvidia GPUs sorted by CUDA cores

List of desktop Nvidia GPUS ordered by CUDA core count

I created it for those who use Neural Style

Guys, please add your hardware setups, neural-style configs and results in comments!

GPU CUDA cores Memory Processor frequency
GeForce GTX TITAN Z 5760 12 GB 705 / 876
#!/usr/bin/env python
import os
import sys
import subprocess
from piptools import CACHE_DIR
def main(requirements_in):
@chiedo
chiedo / boot2docker-nfs-osx.md
Last active October 4, 2019 20:32
Configuring boot2docker to use NFS on an OSX machine

Configuring Boot2Docker to use NFS on an OSX based machine

  • To improve the speed of Boot2Docker drastically, you will want to set it up to use NFS.
  • You will need to do the following once on your host machine:
    • Add this to /etc/exports on your mac

      # BOOT2-DOCKER-BEGIN
      /Users 192.168.59.103 -alldirs -mapall=501:20
      # BOOT2-DOCKER-END
      

Preview build: Container grouping and stack composition

NOTE: this is out of date - refer to moby/moby#9694

Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups) and stack composition (docker up). Together, they will eventually form a complete replacement for Fig.

@pascalmouret
pascalmouret / image_filer_export.py
Created November 16, 2012 21:46
Django Management Command to export image_filer as folder-structure
# author: Pascal Mouret
# purpose: Django Management Command to export image_filer as folder-structure
from django.core.management.base import BaseCommand
from django.conf import settings
from image_filer.models import Folder
import os
import shutil
class Command(BaseCommand):
@stefanfoulis
stefanfoulis / chainable_manager.py
Created November 9, 2012 13:56 — forked from ojii/chainable_manager.py
Django Model Managers
from django.db import models
from django.db.models.query import QuerySet
class ChainableManager(models.Manager):
"""
A manager that allows chaining of all methods defined on it.
Example:
class MyManager(ChainableManager):
@ojii
ojii / Makefile
Last active October 12, 2015 11:28
my django CMS Makefile for testing
ENV_BASE=env
REQUIREMENTS_DIR=test_requirements
define runtests
virtualenv-$1 $(ENV_BASE)-$1-$2
$(ENV_BASE)-$1-$2/bin/pip install $(PIP_FLAGS) -r $(REQUIREMENTS_DIR)/django-$2.txt
$(ENV_BASE)-$1-$2/bin/python runtests.py $(TEST_FLAGS)
endef
all: py25dj13 py25dj14 py26dj13 py26dj14 py26djtrunk py27dj13 py27dj14 py26dj15 py27dj15 py33dj16 py26djtrunk py27djtrunk py33djtrunk
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@beniwohli
beniwohli / fill_translations.py
Created February 2, 2012 09:03
Django management command to copy translations from one po file into another
# -*- coding: utf-8 -*-
import os
from optparse import make_option
import polib
from django.core.management import CommandError
from django.core.management.base import AppCommand