Skip to content

Instantly share code, notes, and snippets.

View jmelosegui's full-sized avatar

Juan Manuel Elosegui jmelosegui

View GitHub Profile
using System;
using System.Diagnostics;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interactivity;
using System.Windows.Interop;
using GitHub.Helpers;
using ReactiveUI;
@SLaks
SLaks / ExcelResult.cs
Created July 4, 2012 02:40
ExcelExporter.Mvc – A simple ActionResult for returning Excel files from ASP.Net MVC actions using ExcelExporter
using System;
using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
namespace ExcelExporter.Mvc {
///<summary>An ActionResult that sends an Excel spreadsheet to the client.</summary>
public class ExcelResult : FilePathResult {
static readonly Dictionary<ExcelFormat, string> ContentTypes = new Dictionary<ExcelFormat, string> {
{ ExcelFormat.Excel2003, "application/vnd.ms-excel" },
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@rxaviers
rxaviers / gist:7360908
Last active November 18, 2024 09:26
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ivandrofly
ivandrofly / Unicode table
Created May 4, 2014 02:20
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@SteveSanderson
SteveSanderson / somefile.cs
Last active May 11, 2016 23:56
Async void message loop
public class MyNetworkClient {
public async Task ConnectAsync(string address) {
await this.MakeTheActualConnection(address);
this.BeginReceiveLoop();
}
// It's async void! But is that bad?
// I know that an unhandled exception here is going to bring down the process, but where else do you want
// that exception to go? There's no external control flow that can reasonably receive such an exception.
private async void BeginReceiveLoop() {
@kylebrandt
kylebrandt / Backup Cronjob
Created May 20, 2016 16:31
Redis Config, Version, Backup for Stack Overflow's Bosun Instance
0 * * * * cp -a /var/lib/redis/bosun-redis.rdb '/mnt/bosun_backup/bosun_redis_'$(date +\%Y-\%m-\%d-\%H).rdb && find '/mnt/bosun_backup/' -maxdepth 1 -name 'bosun_*.rdb' -ctime '+2' -delete
## Hmpf, ctime makes no since, just noticed, but whatever.
@NickCraver
NickCraver / ExampleUsage.cs
Last active October 16, 2024 02:37
Code to mark a SQL string before it's passed to Dapper.
public static List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null)
{
using (db.Connection.EnsureOpen())
{
try
{
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList();
}
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906))
{
@g0t4
g0t4 / Notes.md
Last active November 4, 2024 06:15
Getting Started with Docker on Windows
@domwrap
domwrap / Google Music All Access Family Plan for G-Suite GMail Vanity Domains.md
Last active August 24, 2023 02:26
Google Music All Access Family Plan for G-Suite / GMail Vanity Domains

Google Music All Access Family Plan for G-Suite / GMail Vanity Domains

Synopsis

I had wondered about this some weeks ago before finally trying it out today. I'm surprised nobody else had tried already. I was successful enough to be satisfied for my own uses. YMMV.

Result is I have a new Play Music account with Family Sharing which I can share with my G-Suite users, with all my playlists* moved over, and without anyone needing to maintain a separate email account.

This whole process took me about an hour, including moving across 15 playlists, but not including MX record propagation.