Skip to content

Instantly share code, notes, and snippets.

View BrunoCaimar's full-sized avatar

Bruno Caimar BrunoCaimar

View GitHub Profile
@BrunoCaimar
BrunoCaimar / GravarObjectGraphModoBinario.cs
Created February 28, 2018 18:15
GravarObjectGraphModoBinario.cs
public static void GravarObjectGraphModoBinario(string fileName, object objeto2serialize)
{
using (var stream = new FileStream("C:\\temp\\ObjectGraph.bin",
FileMode.OpenOrCreate,
FileAccess.ReadWrite,
FileShare.ReadWrite))
{
new BinaryFormatter().Serialize(stream, objeto2serialize)
};
}
@BrunoCaimar
BrunoCaimar / geoprocessor.cs
Last active April 6, 2017 12:00
Running a geoprocess inside C# (AO)
public void SampleCalculateBestPathToolGping()
{
// Initialize the geoprocessor.
IGeoProcessor2 gp=new GeoProcessorClass();
// Add the BestPath toolbox.
gp.AddToolbox(@"C:\SanDiego\BestPath.tbx");
// Generate the array of parameters.
IVariantArray parameters=new VarArrayClass();
@BrunoCaimar
BrunoCaimar / comics.md
Created May 6, 2016 11:59
Comics/Graphic Books

The Complete Persepolis - by Marjane Satrapi (Author)

O MURO - FRAIPONT, CELINE / BAILLY, PIERRE

PILULAS AZUIS - PEETERS, FREDERICK / SCHEIBE, FERNANDO

O ARABE DO FUTURO - SATTOUF, RIAD

@BrunoCaimar
BrunoCaimar / set_proxy_environment.py
Created April 15, 2016 17:54
Python - Set Proxy via Environment Variables
def set_proxy_environment_variables():
proxies = urllib.getproxies()
http_proxy = proxies.get('http')
https_proxy = proxies.get('https')
Utils.logs("Proxies: {0}".format(proxies))
if http_proxy is not None and http_proxy != "":
Utils.logs("Configurando http proxy: {0}".format(http_proxy))
os.environ["HTTP_PROXY"] = http_proxy
@BrunoCaimar
BrunoCaimar / get_token_arcmap.py
Created April 13, 2016 12:28
Get AGOL Token on ArcMAP
def _getTokenArcMap(self):
token_response = arcpy.GetSigninToken()
if token_response and 'token' in token_response:
self._token = token_response['token']
self._expires_in = token_response['expires']
self._token_expires_on = datetime.datetime.fromtimestamp(token_response['expires'] / 1000) - \
datetime.timedelta(seconds=1)
self._referer_url = token_response['referer']
return self._token
@BrunoCaimar
BrunoCaimar / python_modules.py
Created April 1, 2016 12:23
Python -m Stuff
python -m SimpleHTTPServer 8000
@BrunoCaimar
BrunoCaimar / add_layer_on_mxd.py
Created January 11, 2016 19:28
Add Layer on MXD
def add_layer_on_mxd(layer_path):
"""
Adiciona uma layer ao mxd atual.
"""
mxd = arcpy.mapping.MapDocument("CURRENT")
data_frames = arcpy.mapping.ListDataFrames(mxd, "*")[0]
newlayer = arcpy.mapping.Layer(layer_path)
arcpy.mapping.AddLayer(data_frames, newlayer, "BOTTOM")
add_layer_on_mxd("IN_MEMORY\FeatureCabos_T2UVATGGKJ")
@BrunoCaimar
BrunoCaimar / agile_brazil_2011_notes.md
Created October 30, 2015 19:11
Agile Brazil 2011 - Notes

Agile 2011 Notes

  • Sadalage.com
  • Agile Databases -- Good carreer oportunity (maybe!)

Rafael - Agile distribuido

  • Todo mundo quer ser agil mesmo não sabendo pq
@BrunoCaimar
BrunoCaimar / retrospectives.md
Created October 30, 2015 19:10
Retrospectivas

Retrospectives

  • Set the goals clearly

  • Set the context clearly

  • Be very carefull with anonymous complains - Have a plan to do with it

Safety check activities - Check In Activity or some like that is very important to have a view of how people feel

A lot of time retrospectives are about emotions. It's important to people to feel good and feel happier!

@BrunoCaimar
BrunoCaimar / geodata.md
Created October 14, 2015 20:36
Dados Geográficos Governamentais Abertos - Onde Encontrar?