python -c "import sys; print('\n'.join(sys.path))"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hook is run after a new virtualenv is activated. | |
# ~/.virtualenvs/postmkvirtualenv | |
libs=( PyQt4 sip.so ) | |
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") | |
var=( $(which -a $python_version) ) | |
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' Python command line argument example using argparse module | |
Example output: | |
./parser.py --server=pyserver --port=8080,443,25,22,21 --keyword=pyisgood | |
Server name: [ pyserver ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
constructor() { | |
this.greeting = 'hello'; | |
} | |
talk() { | |
alert(this.greeting); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var greeting = 'hello'; | |
class Person { | |
constructor() { | |
throw 'You\'re trying to instantiate a singleton.'; | |
} | |
static talk() { | |
alert(greeting); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#define SQL(...) #__VA_ARGS__ | |
int main() | |
{ | |
std::string query(SQL( | |
SELECT | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{BufRead}; | |
fn main() { | |
println!("Type :quit<Enter> to quit this program."); | |
let stdin = std::io::stdin(); | |
loop { | |
let line = stdin.lock().lines().next().unwrap().unwrap(); | |
match line.as_ref() { | |
":quit" => std::process::exit(0), | |
_ => { break } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Create the basic SBT project structure. | |
:: Does not overwrite existing project folder. | |
:: Use the command `rd /s /q {folder-name}` for removing existing folder. | |
:: version 0.1 | |
:: author: David Landa | |
:: license: http://creativecommons.org/licenses/by-sa/2.5/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This example shows how to connect to PostgreSQL database server using the `DriverManager` class. | |
It is recommended to use `DataSource` class instead because of connection pooling. | |
compile: javac DatabaseConnectionDemo.java | |
execute: java -cp .;lib\postgresql-X.X.XXXX.jar DatabaseConnectionDemo | |
*/ | |
//package io.uetoyo.gists; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rust Builder Pattern Example | |
struct Foo { | |
x: i32, | |
y: i32, | |
z: i32 | |
} | |
struct FooBuilder { | |
x: i32, |