Skip to content

Instantly share code, notes, and snippets.

View dgleba's full-sized avatar
😁
.

dgleba dgleba

😁
.
View GitHub Profile
@dgleba
dgleba / 1 - intro
Last active December 23, 2015 00:09
1 - Question test q p pic1
1 - Question
test
q
p
@dgleba
dgleba / test.py
Created March 11, 2016 19:55 — forked from mrjoes/test.py
How to customize options in QuerySelectField. High level idea: 1. Hook `create_form` to change options when creating model and `edit_form` when editing model 2. Provide different `query_factory` for the field 3. Do filtering/population logic in the _get_parent_list Alternatively: 1. Can hook `scaffold_form` and change `form.parent.kwargs['query_…
from flask import Flask, request, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.admin.contrib import sqlamodel
from flask.ext import admin
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `survey_001_models_from_tables` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `survey_001_models_from_tables` ;
-- -----------------------------------------------------
-- Table `survey_001_models_from_tables`.`organizations`
-- -----------------------------------------------------
@dgleba
dgleba / perfectelementary.bash
Created December 16, 2016 23:50
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@dgleba
dgleba / Minimal eclipse install
Last active May 24, 2017 13:31 — forked from mjwall/Minimal eclipse install
Minimal eclipse install
Tired of extra plugins and cruft in eclipse, I tried the following
1. Download platform binary runtime from
http://archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200/
2. Modify eclipse.ini, set -vm JAVA_HOME/bin/java for java 8 and -Xmx2048m
3. Open and run check for updates
Cannot complete the install because one or more required items could not be found.
Software being installed: SFTP Plug-in 0.0.4 (com.jcraft.eclipse.sftp.feature.feature.group 0.0.4)
Missing requirement: SFTP Plug-in 0.0.4 (com.jcraft.eclipse.sftp.feature.feature.group 0.0.4) requires 'org.eclipse.core.runtime.compatibility 0.0.0' but it could not be found
http://www.jcraft.com/eclipse-sftp/
@dgleba
dgleba / eclipse sftp ruby project 2017-05-24
Last active June 6, 2017 12:40
Eclipse Sftp remote ruby project 2017-05-24
ref:
see screenshots.
https://www.dropbox.com/sh/dajsaigu12rycp6/AABHUGU9X9Kh7Zn6-F_v8ymca?dl=0
1.
install eclipse..
- https://www.eclipse.org/downloads/eclipse-packages/
@dgleba
dgleba / gitcreate.sh
Last active June 20, 2017 01:04 — forked from jerrykrinock/gitcreate.sh
This script create a new repo on github.com, then pushes to it the local repo from the current directory.It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
#!/bin/bash
#
# try https://github.com/github/hub/releases
# https://stackoverflow.com/questions/35124997/creating-github-repository-from-command-line
#
# This script create a new repo on github.com, then pushes the local repo from the current directory to the new remote.
# It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
@dgleba
dgleba / brewmamp.sh
Last active June 26, 2017 01:29
OS X 10.10 Yosemite, Apache, MySQL, PHP 5.6, (MAMP) Homebrew Dev Setup
# From http://www.iyware.com/osx-yosemite-mamp-homebrew-development-setup/
# forked from https://gist.github.com/bramus/5b4f4733e543912a518
# David Gleba 2017-06-25_Sun_20.59-PM
# Install Homebrew
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
# Tap Repos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
works...
download cygwin-x86_64.exe
put it in c:\p2\cygwin64localpackages\
mkdir c:\p2\cygwin64localpackages\
wget -N http://www.cygwin.com/setup-x86_64.exe