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
package main | |
import ( | |
"fmt" | |
"math" | |
"runtime" | |
"strings" | |
) | |
const ( |
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
# -*- coding: utf-8 -*- | |
""" | |
Animated 3D sinc function | |
""" | |
from pyqtgraph.Qt import QtCore, QtGui | |
import pyqtgraph.opengl as gl | |
import pyqtgraph as pg | |
import numpy as np | |
import sys |
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
import luigi | |
import time | |
class TimeTaskMixin(object): | |
''' | |
A mixin that when added to a luigi task, will print out | |
the tasks execution time to standard out, when the task is | |
finished | |
''' | |
@luigi.Task.event_handler(luigi.Event.PROCESSING_TIME) |
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
# change to postgres user and open psql prompt | |
sudo -u postgres psql postgres | |
# list databases | |
postgres=# \l | |
# list roles | |
postgres=# \du | |
# create role |
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
// Workflow written in SciPipe. | |
// For more information about SciPipe, see: http://scipipe.org | |
package main | |
import sp "github.com/scipipe/scipipe" | |
func main() { | |
// Create a workflow, using 4 cpu cores | |
wf := sp.NewWorkflow("my_workflow", 4) |
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
import luigi | |
import sciluigi as sl | |
# ... snip ... | |
class GlobFiles(sl.Task): | |
globdir = luigi.Parameter() | |
in_depend = None |
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
SELECT node.title,timestamp,node_revisions.body | |
FROM node | |
LEFT JOIN node_revisions ON node.vid=node_revisions.vid | |
INTO OUTFILE '/tmp/nodes.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; |
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
import luigi | |
class ATask(luigi.Task): | |
def output(self): | |
return luigi.LocalTarget("atask_output.txt") | |
def run(self): | |
with self.output().open("w") as outfile: | |
outfile.write("Test") |
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
import luigi | |
class ATask(luigi.Task): | |
def output(self): | |
return luigi.LocalTarget("atask_output.txt") | |
def run(self): | |
with self.output().open("w") as outfile: | |
outfile.write("Test") |
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 script uses the coverlet tool to generate code coverage statistics about the tests | |
# For more info about coverlet: https://github.com/tonerdo/coverlet | |
# Author: Samuel Lampa | |
# -------------------------------------------------------------------------------- | |
./bin/Debug/netcoreapp2.2/MyApp.Tests.dll: | |
echo "Installing any uninstalled dependencies, by executing dotnet restore ..." | |
dotnet restore | |
dotnet build |
NewerOlder