Skip to content

Instantly share code, notes, and snippets.

View erickmendonca's full-sized avatar
:shipit:
Shippin'

Erick Mendonça erickmendonca

:shipit:
Shippin'
View GitHub Profile
@jgold6
jgold6 / App.cs
Last active December 11, 2017 21:31
Xamarin Forms Custom Map renderer to draw Polylines
using System;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
namespace YourNameSpace
{
public class App : Application
{
public App()
{
from threading import Thread
import requests ## pip install requests
import time
import smtplib
## email sending function
def email_sender(input_message, email_to, client):
''' function to send email '''
to = email_to
gmail_user = '' ## email of sender account
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
@staltz
staltz / introrx.md
Last active June 2, 2024 11:03
The introduction to Reactive Programming you've been missing
import statusInfo = require('./StatusInfo');
import commentInfo = require('./CommentInfo');
var uuid = require('node-uuid');
/**
Various types of user notifications that we can send.
The numeric values are sent to the client apps (Android, iOS, etc) so be careful changing them
*/
enum NotificationType {
from rest_framework import serializers
class HyperlinkedIdentityField(serializers.HyperlinkedIdentityField):
"""
This is a performance wrapper for HyperlinkedIdentityField.
We save a ton of time by not calling reverse potentially
thousands of times per request.
"""
def __init__(self, *args, **kwargs):
@gustavohenrique
gustavohenrique / elementaryos-postinstall
Created October 31, 2013 14:54
Post installation of Elementary OS
First update:
sudo apt-get update && sudo apt-get upgrade
Kernel updates:
sudo apt-get install linux-generic-lts-raring
Essential:
sudo apt-get install build-essential ubuntu-restrict-extras devede winff k3b libavformat-extra-53 libavcodec-extra-53 tomboy vlc audience etube foto gazette faac faad ffmpeg ffmpeg2theora flac icedax id3v2 lame libflac++6 libjpeg-progs libmpeg3-1 mencoder mjpegtools mp3gain mpeg2dec mpeg3-utils mpegdemux mpg123 mpg321 regionset sox uudeview vorbis-tools x264 dconf-editor dconf-tools wingpanel-slim soundconverter gstreamer0.8-plugins gstreamer0.8-mad gstreamer0.8-lame gwenview pinta indicator-synapse vim-gtk tree aria2 links2 gimp unzip msttcorefonts openjdk-6-jdk
Developer:
@jackiekazil
jackiekazil / rounding_decimals.md
Last active January 17, 2024 12:29
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@serra
serra / README.md
Last active June 12, 2023 15:35 — forked from joelverhagen/README.md

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@banaslee
banaslee / XGH - en.txt
Last active May 28, 2024 23:21
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).