Skip to content

Instantly share code, notes, and snippets.

View dacresni's full-sized avatar
🏠
Working from home

Nehemiah I. Dacres dacresni

🏠
Working from home
View GitHub Profile
@dacresni
dacresni / gist:bdd84793b634354463f20bbdbf475016
Created August 6, 2019 14:54
create islands accordding to a rulee
<script>
var islands = document.querySelectorAll("h3 + ul"); // returns array
islands.forEach(function (child) {
let par = child.parentNode ;
let pre = child.previousElementSibling;
var sec = document.createElement('section');
par.replaceChild(sec,pre);
sec.appendChild(pre);
sec.appendChild(child);
sec.setAttribute("class","standout" );
[dacresni@jupyterhub geonode]$ paver setup
---> pavement.setup
---> pavement.setup_geoserver
makedirs path('downloaded')
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network.target
[Service]
User=caddy
#User=root
PermissionsStartOnly=true
ExecStartPre=/sbin/setcap cap_net_bind_service=+ep /usr/bin/caddy
@dacresni
dacresni / qt table to graphics scene
Created August 1, 2012 16:53
this qt code crashes
void MainWindow::on_actionAddTable_triggered()
{
//add table
QTableWidget* newTable = new QTableWidget( 3, 3);
newTable->setHorizontalHeaderLabels(QStringList()<<"1"<<"2"<<"3");
newTable->setVerticalHeaderLabels(QStringList()<<"A"<<"B"<<"C");
qDebug() <<" table labled";
// row mod(26) = letter
QWidget * thisPage = pageStack->currentWidget();
QGraphicsView * thePage = dynamic_cast<QGraphicsView*>(thisPage);
@dacresni
dacresni / gist:973708
Created May 16, 2011 00:19
suggestion for getting process info on BSD and other posix non linux OS (like mac os
you may be able to get BSD portability (with macos for free) if you use sysctl instead of the NS namespace like NSGetExecutablePath. could you use sysctl? kern.proc.pid ?
( see http://www.unix.com/man-page/FreeBSD/3/sysctl/) KERN_PROC_PID) honistly this will be