Skip to content

Instantly share code, notes, and snippets.

@i5on9i
i5on9i / out_of_core_naive_bayes.py
Last active June 27, 2016 15:32
how to use out-of-core ver. naiveBayes of scikit-learn library
"""
======================================================
Out-of-core classification of text documents
======================================================
simplified source of
http://scikit-learn.org/stable/auto_examples/applications/plot_out_of_core_classification.html
"""
@i5on9i
i5on9i / vscode.tmTheme
Created June 29, 2016 03:11
sublimetext color theme : this is vscode-like color theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
vscode like theme by namh
-->
<plist version="1.0">
<dict>
<key>name</key>
<string>vscode</string>
<key>settings</key>
/**
You could use this source for babel-react / babel-ecma6
*/
//--------------------------------
//
// main.js
//
//--------------------------------
+-----------+ +-----------+
| | | |
| client | | server |
+-----------+ +-----------+ +-------------------------+
+ + | global_message_buffer |
| |+----------------------------->| |
| POST button is clicked | +-----------+-------------+
| uri: a/message/new | +
@i5on9i
i5on9i / zipfile_usage.py
Last active July 20, 2016 04:47
how to use zipfile of python / how to zip folder
import zipfile
import os, os.path
def unzip(filename, dest):
with zipfile.ZipFile(filename) as zf:
zf.extractall(dest)
def zipdir(newFilename, targetPath):
/**
Pure javascript instead of jQuery
code is from http://youmightnotneedjquery.com/
*/
/**
* to serialize the inputs' data of the {@param form}
*/
const serialize = (fromEl)=>{
@i5on9i
i5on9i / base.py
Last active April 14, 2017 13:03
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
"""Production settings and globals."""
from __future__ import absolute_import
from os import environ
from .base import *
# Normally you should not import ANYTHING from Django directly
@i5on9i
i5on9i / local.py
Last active April 16, 2024 19:52
"""Development settings and globals."""
from __future__ import absolute_import
from os.path import join, normpath
from .base import *
# DEBUG CONFIGURATION
# coding=utf-8
from rest_framework import exceptions
from rest_framework.authentication import BaseAuthentication, CSRFCheck
__author__ = 'namh'
class CsrfAuthentication(BaseAuthentication):
"""