Skip to content

Instantly share code, notes, and snippets.

View dijeferson's full-sized avatar
🚀
Developing Great Software!

Jeferson Dos Santos dijeferson

🚀
Developing Great Software!
View GitHub Profile
tell application "Microsoft Outlook"
set theMessage to first item of (get current messages)
set theSubject to the subject of theMessage
set theBody to the plain text content of theMessage
set theID to the id of theMessage
end tell
tell application "Things3"
show quick entry panel with properties {name:theSubject, notes:theBody}
end tell
@dijeferson
dijeferson / StyleForKeys.html
Created March 13, 2018 15:31
Nice CSS for showing key combinations
<html>
<head>
<style>
.kbd {
position: relative;
top: -1px;
color: #333;
font-size: 0.8em;
background-color: #fff;
@dijeferson
dijeferson / BuilderDesignPattern.cs
Last active March 7, 2018 15:33
Simple sample of a Builder Design Pattern implementation in C#
using System;
using System.Collections.Generic;
using System.Text;
namespace Builder
{
public class Url
{
private string basePath = string.Empty;
private Dictionary<string, string> parameters = new Dictionary<string, string>();
@dijeferson
dijeferson / RecursiveGitStatus.sh
Created December 5, 2017 07:45
Recursive Git Status
# Recursive Git Status
git-recv() {
GREEN='\033[0;32m'
NC='\033[0m' # No Color
find . -name .git -type d | while read dir ; do echo -e "${GREEN}Repository ==>${NC} $(dirname $dir)" ; git -C $(dirname $dir) status -s ; done
}
### Keybase proof
I hereby claim:
* I am dijeferson on github.
* I am dijeferson (https://keybase.io/dijeferson) on keybase.
* I have a public key whose fingerprint is C466 C331 75EB D969 144E 96C6 B410 5791 E3D7 05AB
To claim this, I am signing this object:
@dijeferson
dijeferson / BackButtonWithMessageDialog.cs
Created January 26, 2016 18:58
POC para verificar o comportamento do MessageDialog quando é pressionado o botão "Back" do dispositivo.
string result = string.Empty;
MessageDialog msg = new MessageDialog("Quando apertar o botão 'back' do device, deve selecionar a opcao 'mais tarde'!", "POC");
msg.Commands.Add(new UICommand("Atualizar", new UICommandInvokedHandler((command) =>
{
result = "Clicou em atualizar";
})));
msg.Commands.Add(new UICommand("Mais tarde!", new UICommandInvokedHandler((command) =>
@dijeferson
dijeferson / UniqueID.cs
Created December 8, 2015 12:50
Gerando um UniqueID por dispositivo no Windows Phone 8.1
var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles();
var adapter = networkProfiles.First<Windows.Networking.Connectivity.ConnectionProfile>().NetworkAdapter;
string networkAdapterId = adapter.NetworkAdapterId.ToString();
@dijeferson
dijeferson / AutoGenerateInterface.py
Last active November 23, 2015 21:05
The purpose of this script is to create the c# interface of public classes automatically, based on it's public methods and properties.
# Author Jeferson Santos
# jefersonsantos.com
# @dijeferson
# Imports
import re
# Methods
def isPublicClass(content):
pattern = r'(public class\s)(\w+)'
@dijeferson
dijeferson / Embed Gists with a URL
Created November 19, 2015 02:04 — forked from bhwebworks/Embed Gists with a URL
Add to functions.php or a mu-plugin
/**
* Embed Gists with a URL
*
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*
@dijeferson
dijeferson / DictToExpando.cs
Created November 5, 2015 19:44 — forked from theburningmonk/DictToExpando.cs
Dictionary to Expando
/// <summary>
/// Extension method that turns a dictionary of string and object to an ExpandoObject
/// </summary>
public static ExpandoObject ToExpando(this IDictionary<string, object> dictionary)
{
var expando = new ExpandoObject();
var expandoDic = (IDictionary<string, object>)expando;
// go through the items in the dictionary and copy over the key value pairs)
foreach (var kvp in dictionary)