Skip to content

Instantly share code, notes, and snippets.

View odoe's full-sized avatar
👽
It's full of stars

Rene Rubalcava odoe

👽
It's full of stars
View GitHub Profile
@odoe
odoe / EventedMap.js
Created September 17, 2012 22:05
Evented based esri.Map
// Because I was bored and wanted to use the foo.on() method with my map
define(['dojo/_base/declare', 'dojo/Evented'], function(declare, Evented) {
var EventedMap = declare([Evented, esri.Map], {
constructor: function() {
var _this = this;
dojo.connect(this, "onClick", function(event) {
return _this.emit("click", event);
});
dojo.connect(this, "onDblClick", function(event) {
source-file "${HOME}/.tmux-themepack/powerline/block/cyan.tmuxtheme"
@odoe
odoe / Stopwatch.m.css
Created March 29, 2020 18:34
dojo timer widget
@import url('https://fonts.googleapis.com/css?family=Orbitron&display=swap');
@import './variables.css';
.root {
padding: 1rem;
text-align: center;
}
.timer {
font-family: 'Orbitron', sans-serif;
// original AMD version
define([
'views/MapView',
'views/LocatorView'
], function(
MapView, LocatorView
) {
var node = document.getElementById('map-area');
var node2 = document.getElementById('locator-area');
var mapView = new MapView(null, node);
@odoe
odoe / answers.ts
Last active December 4, 2019 14:51
AdventOfCode-2019
// Part 1
/**
For a mass of 12, divide by 3 and round down to get 4, then subtract 2 to get 2.
For a mass of 14, dividing by 3 and rounding down still yields 4, so the fuel required is also 2.
For a mass of 1969, the fuel required is 654.
For a mass of 100756, the fuel required is 33583.
**/
function fuelCounterUpper(mass: number): number {
@odoe
odoe / esritogeo.js
Created November 23, 2011 16:58
Convert ESRI-JSON to GeoJSON
var stripJSON = function(str) {
return str.replace(/\\n/g, "\\n")
.replace(/\\t/g, "\\t");
};
var jsonToObject = function(stringIn) {
var data;
try {
data = JSON.parse(stripJSON(stringIn));
console.log("json converted to object");
snippet dtsx "Dojo tsx widget"
import { create, tsx } from '@dojo/framework/core/vdom';
const factory = create();
export default factory(function $1() {
return (
<div>Widget</div>
);
});
@odoe
odoe / create_sde_connection.py
Created April 26, 2012 20:07
Arcpy script to add data to mxd and publish to ArcGIS server without ArcMap
'''
Created on Feb 24, 2011
The purpose of this script is to create the SDE connection file needed to connect to your SDE
@author: rrubalcava
'''
import os, arcpy
class CreateSDEConnection:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>My First Map</title>
<style>
html,
body,
#viewDiv {
@odoe
odoe / .vimrc
Created July 13, 2019 16:30
vim setup
" minpac package manager
" Try to load minpac.
packadd minpac
if !exists('*minpac#init')
" minpac is not available.
" Settings for plugin-less environment.
" ...
else