Skip to content

Instantly share code, notes, and snippets.

View SamuelMarks's full-sized avatar
:octocat:
C > Rust > Go > TypeScript > C++

Samuel Marks SamuelMarks

:octocat:
C > Rust > Go > TypeScript > C++
View GitHub Profile
"use strict";
var http_1 = require('http');
function httpF(method) {
return function (options, body_or_cb, cb) {
if (!cb) {
cb = body_or_cb;
body_or_cb = null;
}
options['method'] = method;
if (body_or_cb)
mongoose.connect = MongooseThenable {
connections:
[ NativeConnection {
base: [Object],
collections: {},
models: {},
config: [Object],
replica: false,
hosts: null,
host: '192.168.2.2',
@SamuelMarks
SamuelMarks / diff -r example2 generator-m-ionic-demo
Created January 6, 2016 13:12
diff -r example2 generator-m-ionic-demo
diff -r example2/.yo-rc.json generator-m-ionic-demo/.yo-rc.json
4,6c4,6
< "appName": "example2",
< "appId": "com.company.example2",
< "ionicCss": false,
---
> "appModule": "myProject",
> "appName": "My Project",
> "appId": "com.company.project",
12a13
/tmp/a$ gulp karma
[16:05:10] Using gulpfile /tmp/a/gulpfile.js
[16:05:10] Starting 'eslint'...
[16:05:10] Starting 'jsonlint'...
[16:05:11] Finished 'jsonlint' after 294 ms
[16:05:11] Finished 'eslint' after 450 ms
[16:05:11] Starting 'linting'...
[16:05:11] Finished 'linting' after 12 μs
[16:05:11] Starting 'karma'...
29 12 2015 16:05:11.367:WARN [watcher]: Pattern "/tmp/a/app/**/templates/*.html" does not match any file.
#!/usr/bin/env python
import json
from sys import argv
from os import path
with open(argv[1]) as f:
s = f.readlines()
session = json.loads(s[4])
@SamuelMarks
SamuelMarks / CMakeLists.txt
Created November 17, 2015 11:19
phc-winner-argon2 CMake
cmake_minimum_required(VERSION 3.3)
project(phc_winner_argon2)
set(SOURCE_FILES
src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c)
set(SRC_RUN src/run.c)
set(SRC_BENCH src/bench.c)
set(SRC_GENKAT src/genkat.c)
set(RUN argon2)
@SamuelMarks
SamuelMarks / cloud.md
Last active September 27, 2020 17:54
Docker cloud: PaaS, orchestration, resource-sharing, provisioning

Experimenting with Docker technologies and related supporting infrastructure, as I'm sure many of you are.

Disclaimer: seeking an opinionated architecture, not a wiki (like: https://github.com/veggiemonk/awesome-docker)

In essence, I am building an open-source cloud that:

  • fans-in/out elastically

  • supports multiple public and private cloud providers

@SamuelMarks
SamuelMarks / upgrade_all_pip_packages.py
Last active February 8, 2016 06:24
Upgrade all packages using pip
#!/usr/bin/env python
from __future__ import print_function
from sys import stderr
from pip import get_installed_distributions
from pip.commands import install
from pip.exceptions import InstallationError
@SamuelMarks
SamuelMarks / gen_png_from_dot.bash
Created March 9, 2015 22:57
gen_png_from_dot.bash
#!/usr/bin/env bash
if [ -z "$1" ]; then
>&2 echo "Usage: gen_png_from_dot <dot_file> <png_location=exports>"
exit 1
fi
while inotifywait -e close_write "$1";
do `which dot` -Tpng -o "${2:-exports}/${1%???}.png" "$1";
done
@SamuelMarks
SamuelMarks / setup.py
Last active August 29, 2015 14:15
An attempt to explicitly installs package dependencies **before** running `setuptools.setup`…
from pip.commands import install
from pip.exceptions import DistributionNotFound
def setup2(**kwargs):
kwargs['install_requires'] = kwargs.get('dependency_links', []) + kwargs.get('install_requires', [])
if path.exists('requirements.txt'):
kwargs['install_requires'] += open('requirements.txt', 'r').readlines()