Skip to content

Instantly share code, notes, and snippets.

View zedauna's full-sized avatar
🎯
Focusing

VIGAN Jéros zedauna

🎯
Focusing
View GitHub Profile
@monstermunchkin
monstermunchkin / cp_with_prog.py
Created April 15, 2012 10:14
Copy function with progress display in Python
#!/usr/bin/python
# Copy function with progress display using a callback function.
# The callback function used here mimics the output of
# 'rsync --progress'.
# Copyright (C) 2012 Thomas Hipp
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ryanwitt
ryanwitt / gist:2911560
Created June 11, 2012 17:46
Confusion matrix for a logistic glm model in R. Helpful for comparing glm to randomForests.
confusion.glm <- function(data, model) {
prediction <- ifelse(predict(model, data, type='response') > 0.5, TRUE, FALSE)
confusion <- table(prediction, as.logical(model$y))
confusion <- cbind(confusion, c(1 - confusion[1,1]/(confusion[1,1]+confusion[2,1]), 1 - confusion[2,2]/(confusion[2,2]+confusion[1,2])))
confusion <- as.data.frame(confusion)
names(confusion) <- c('FALSE', 'TRUE', 'class.error')
confusion
}
@mhegeman
mhegeman / conditionalExport_current.py
Last active April 20, 2022 19:59
GACU Conditonal Program Maps
#Author: Melissa Albino Hegeman, melissa.hegeman@gmail.com
#Date: November 2012
#Purpose: This script is meant to be run in ArcMap with the appropriate conditional shellfish program map
# after you have completed steps one and two in making a new condtional program map.
# This is step three of three. There are no parameters and the file will export to the
# users private Citrix folder.
import arcpy
#Use the current map document
@mbostock
mbostock / .block
Last active March 26, 2024 18:26 — forked from mbostock/.block
Curved Links
license: gpl-3.0
@oevans
oevans / AGO_PullHostedFeatures.py
Last active February 12, 2026 12:56
Python script to pull hosted features with attachments into a local file geodatabase. See ReadMe below.
import os, urllib, urllib2, datetime, arcpy, json
## ============================================================================== ##
## function to update a field - basically converts longs to dates for date fields ##
## since json has dates as a long (milliseconds since unix epoch) and geodb wants ##
## a proper date, not a long.
## ============================================================================== ##
def updateValue(row,field_to_update,value):
outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field
class _SliderMenuActions
constructor:->
$page = $('#page') ##ID must be that of the page that slides
$menuBtn = $('#menuBtn') ## To add click events to a button to open and close menu
sidebar = false
sidebarOffset = window.innerWidth - 40
$page.hammer()
.on('drag', (event)->
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 27, 2026 07:26
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@chris-creditdesign
chris-creditdesign / D3.js-map-Location,-Drag-+-Zoom.markdown
Created November 22, 2014 12:55
D3.js map Location, Drag + Zoom
@Neilos
Neilos / README.md
Last active June 17, 2024 22:35
Bi-directional hierarchical sankey diagram

This is a demonstration of a bi-directional hierarchical sankey diagram produced in javascript, html and css using d3. (Refresh page to generate new random data)

Sankey diagrams represent flows between nodes by varying the thickness of the connecting links.

This diagram was based off of Mike Bostock's sankey diagram, but additionally incorporates bi-directionality into the flow and caters for hierarchical relationships between nodes to allow drill down into the data.

All javascript code to generate the diagram markup is contained in the app.js file, but the underlying calculations are performed using a custom plugin: bihisankey.js.

@black-tea
black-tea / ArcPySpatialJoin.py
Last active April 8, 2022 03:57
Basic Spatial Join in ArcPy. In this case, a one-to-many that will create new rows for every match.
#### This script will take the Riits Sensor Shp, and copy the assetIDs of all intersecting points to the attribute table of the Riits layer
import arcpy
from arcpy import env
env.workspace = "Z:/GIS/DataLibrary/Transportation/BOE_Centerline_Intersections150930/collisiontoInt_test.gdb"
env.overwriteOutput = True #so we can rerun this script and overwrite our output feature class
#input
Riits_sensor_shp = "Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/RiitsSensorsproj.shp"