Skip to content

Instantly share code, notes, and snippets.

Wojtek wklm

Block or report user

Report or block wklm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d1e79aca19d606769ad37c156321497d
bash-4.2# pip3.6 install cx_Oracle
Requirement already satisfied: cx_Oracle in /usr/lib64/python3.6/site-packages
bash-4.2# python3.6 app.py
Traceback (most recent call last):
File "app.py", line 1, in <module>
import cx_Oracle
ModuleNotFoundError: No module named 'cx_Oracle'
View gist:f7271e0b68c273e528b85157993c1134
bash-4.2# python3.6 -m site
sys.path = [
'/syncro',
'/usr/local/lib/python36.zip',
'/usr/local/lib/python3.6',
'/usr/local/lib/python3.6/lib-dynload',
'/usr/local/lib/python3.6/site-packages',
]
USER_BASE: '/root/.local' (doesn't exist)
USER_SITE: '/root/.local/lib/python3.6/site-packages' (doesn't exist)
View gist:c61742b951943393bfdbb751d76ad136
bash-4.2# head $(which pip3.6)
#!/usr/bin/python3.6
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3.6'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
View gist:737f948bf2fa8f9ff7e457f31afbd3f2
bash-4.2# which python3.6
/usr/local/bin/python3.6
bash-4.2# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/12.2/client64/bin
bash-4.2#
View response code
if resp.status_code == 200:
return resp
if resp.status_code == 404:
raise ModelNotFound(instance_type, self.model_names)
if resp.status_code == 500:
raise InternalInventoryError
View fac.ml
let rec factorial (number : int) =
if number >= 1 then number * factorial (number - 1)
else 1
print_int (factorial 242);;
View factorial.ml
#use "topfind"
#thread
#require "core"
open Core
let rec factorial (number : int) =
if number >= 1 then number * factorial (number - 1)
else 1 ;;
View users.fs
module Program
open Chiron
open Suave
open Suave.Filters
open Suave.Json
open Suave.Operators
open Suave.Successful
type User =
@wklm
wklm / silicon-valley.fs
Last active Sep 14, 2017
Suave + Chrion nested jsons simple example
View silicon-valley.fs
module Program
open Chiron
open Suave
open Suave.Filters
open Suave.Json
open Suave.Operators
open Suave.Successful
@wklm
wklm / fib.fs
Last active Sep 24, 2017
fibonacci async
View fib.fs
let rec fib = function
| 0L | 1L as n -> n
| n -> (fib (n - 1L) + fib (n - 2L))
let memoize f =
let memo = ref Map.empty
fun arg ->
if Map.containsKey arg !memo then Map.find arg !memo
else
let result = f arg
You can’t perform that action at this time.