Skip to content

Instantly share code, notes, and snippets.

@oak-tree
oak-tree / part8.m
Created September 6, 2015 13:49
part8_net
net_arch = {...
struct('type','input','inInd',0,'outInd',1,'blobSize',[H,W,B,batch_size],'fName',train_images_file,'scale',1/256,'dataType','uint8'), ...
struct('type','input','inInd',0,'outInd',2,'blobSize',[k,batch_size],'fName',train_labels_file,'scale',1,'dataType','uint8'), ...
...
struct('type','conv','inInd',1,'outInd',3,'kernelsize',conv_kernel,'stride',conv_stride,'nOutChannels',conv_channels1,'bias_filler',0),...
struct('type','relu','inInd',3,'outInd',3), ...
struct('type','maxpool','inInd',3,'outInd',4,'kernelsize',pool_kernel,'stride',pool_stride), ...
...
struct('type','conv','inInd',4,'outInd',5,'kernelsize',conv_kernel,'stride',conv_stride,'nOutChannels',conv_channels2,'bias_filler',0),...
struct('type','relu','inInd',5,'outInd',5), ...
@oak-tree
oak-tree / scaleToContent
Created November 3, 2015 19:29
playing with scaling webpage to zoom by injecting js code to it
var resetMetaTag = function(){
metaTag = document.getElementsByName('viewport')
console.log('removing existing meta tag if any if none exist then create one')
console.log(metaTag.length)
if(metaTag.length > 0 ) {
metaTag[0].remove();
console.log('removing existing meta tag if any')
} else {
@oak-tree
oak-tree / RUN_CAFFE_ON_DOCKER.md
Last active November 27, 2015 07:46
Run caffe on docker on windows

Docker

Install docker

Run docker

(cd /c/Program\ Files/Docker\ Toolbox/ ; ./start.sh)

Connect to docker container

run docker ps

run docker attach <containername|hash>

@oak-tree
oak-tree / .gitconfig
Last active December 14, 2015 10:09
pretty print for git log
##BASED on http://blog.kfish.org/2010/04/git-lola.html
## more on git log parameters http://git-scm.com/docs/pretty-formats
[alias]
#lol = log --graph --decorate --pretty=oneline --abbrev-commit
lol = log --graph --decorate --pretty=format:'%C(auto) %h %D %s - author: %Cblue %an' --abbrev-commit
#lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lola = log --graph --decorate --pretty=format:'%C(auto) %h %D %s - author: %Cblue %an' --abbrev-commit --all
##credit to on https://plus.google.com/u/0/107195974066798722742
logm = log --decorate=short --pretty=format:'%C(yellow) %h %C(blue) %s %C(reset)(%C(red)by %cN %C(green)on %cD%C(reset))' --merges
@oak-tree
oak-tree / css min issue
Created January 6, 2016 14:08
css min issue
cssmin:
{ dist: { files: { '<%= yeoman.dist %>/styles/main.css': [ '.tmp/styles/{,*/}*.css', 'source/styles/{,*/}*.css' ] } },
generated:
{ files:
[ { dest: 'www\\styles\\css\\main.css',
src: [ '.tmp\\concat\\styles\\css\\main.css' ] } ] } }
Running "concat:generated" (concat) task
Verifying property concat.generated exists in config...OK
Files: source/styles/css/reset.css, source/styles/css/index.css, source/styles/css/centure.css, source/styles/css/layout.css, source/styles/css/wizard.css, source/styles/css/hagderMenu.css, source/styles/css/header.css, source/styles/css/box.css, source/styles/css/footer.css, source/styles/css/overlay.css, source/bower_components/backgrid/lib/backgrid.css, source/bower_components/backgrid-paginator/backgrid-paginator.css, source/bower_components/backgrid-filter/backgrid-filter.css, source/styles/css/about.css, source/styles/css/grid.css, source/styles/css/photos.css, source/styles/css/editor.css, source/styles/css/colors.css -> .tmp\concat\styles\css
@oak-tree
oak-tree / iframe.html
Last active January 25, 2016 12:08
Test environment for birds.co.il
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<style type="text/css">
html, body {
height: 100%;
margin: 0;
}
iframe {
@oak-tree
oak-tree / loadcsvlocal.sql
Created February 8, 2016 15:37
how to load csv file into mysql
LOAD DATA INFILE 'treksheb.csv' into table treks_heb
-> FIELDS TERMINATED BY ','
-> ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n'
-> IGNORE 1 LINES
-> (ProductId,name,Shortdescription,FullDescription,AttributeTypeId,CustomValue,DisplayOrder,SpecificationAttributeName,SpecificationAttributeOptionName);
for (i=1;i<100;i++) {console.log(i + " " + Math.log2(i) + " " + Math.ceil(Math.log2(i)));}
@oak-tree
oak-tree / commands.sh
Last active June 23, 2016 14:02
installing ngix + mysql on ec2 ubuntu
####READ COMMENTS
#### comments contain instruction that are must be done and not via terminal!
#############################################################################
# install ubuntu
# make sure to add security group that allows to connect mysql instance
sudo apt-get update
# add ngix repository
#ubnutu get stable
sudo -s
@oak-tree
oak-tree / nginx + php
Created June 23, 2016 09:53
nginx + php configration
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
#
# # With php5-cgi alone: