Skip to content

Instantly share code, notes, and snippets.

@awhitesong
awhitesong / .theanorc
Created March 16, 2017 20:37
theanorc file
[global]
device = gpu
floatX = float32
optimizer = fast_run
optimizer_including=cudnn
mode=FAST_RUN
[blas]
ldflags = -L/usr/lib -lopenblas
@awhitesong
awhitesong / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Created March 16, 2017 14:32 — forked from whizzzkid/XPS-15 9560 Getting Nvidia To Work on KDE Neon
Making Nvidia Drivers + CUDA 8 + Bumblebee work together on XPS 15 Early 2017 9560 kabylake.
# Update to 4.9 kernel do not delete the old kernel as it will be your failsafe if something happens to this one
# Install KabyLake graphics patches
cd /tmp;
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2;
tar xjvf kbldmcver101.tar.bz2; cd kbl_dmc_ver1_01/; sudo ./install.sh
cd /tmp;
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kblgucver914.tar.gz;
tar xvzf kblgucver914.tar.gz; cd firmware/kbl/guc/kbl_guc_ver/; sudo ./install.sh
@awhitesong
awhitesong / git-cheat-list.md
Created February 18, 2017 06:51
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
@awhitesong
awhitesong / mysqlBulkInsert.php
Last active January 28, 2017 19:53
BULK INSERT mysql PHP
// START OF CLASSES
// This class creates the connection and passes parameters to prepared statement class.
class db extends mysqli {
public function m_prepare($partialQuery, $quoteCount) {
if ($quoteCount < 1) {
return false;
}
return new stmt($this, $partialQuery, $quoteCount);
}
@awhitesong
awhitesong / gist:2d0b98749d8f9f792bc45427a58ec7d6
Last active April 5, 2016 21:54 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask, jsonify, abort, make_response, request
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__)
#Authentification
auth = HTTPBasicAuth()
@awhitesong
awhitesong / readme.md
Created March 22, 2016 21:51 — forked from baraldilorenzo/readme.md
VGG-19 pre-trained model for Keras

##VGG19 model for Keras

This is the Keras model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@awhitesong
awhitesong / rest-server.py
Created March 21, 2016 21:58 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.