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
fn main() { | |
println!("Hello, World!") | |
} |
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
def num_cpu_cores(): | |
with open('/proc/cpuinfo') as f: | |
return f.read().count('processor') |
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/env python2 | |
#-*- coding=utf-8 -*- | |
# © 2013 Mark Harviston, BSD License | |
from __future__ import absolute_import, unicode_literals, print_function | |
""" | |
Qt data models that bind to SQLAlchemy queries | |
""" | |
from PyQt4 import QtGui | |
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt | |
import logging # noqa |
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
/* | |
------------------------------------------------------------------------------ | |
Popis: | |
Úkolem bylo ukázat, jak vytáhnout různá ověření na atributy osoby mimo samotnou | |
třídu osoba. Osoba zná svůj věk, ale neví jestli je plnoletá či smí na horskou dráhu. | |
Takové omezení přichází až z vnějšku a je závislé na kontextu, např. plnoletost je | |
jinak definována v USA než v EU. | |
1) Bude mít rozšíření které ověří, jestli osoba smí pít alkohol (min. 18 let). |
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 | |
# current Git branch | |
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
# v1.0.0, v1.5.2, etc. | |
versionLabel=v$1 | |
# establish branch and tag name variables | |
devBranch=develop |
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
# output binary | |
BIN := test | |
# source files | |
SRCS := \ | |
test.cpp | |
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file) | |
DISTFILES := $(BIN) |
OlderNewer