Skip to content

Instantly share code, notes, and snippets.

@rohansen
rohansen / gist:791b124b0b53f86b4958c4a21fed5333
Created June 2, 2020 11:36
Converting characters and accents to "regular characters"
void Main()
{
Console.WriteLine(RemoveDiacritics2("PIŁKI"));
}
public static string RemoveDiacritics2(string text)
{
if (!string.IsNullOrEmpty(text))
{
Get-ChildItem c:\folder here * -recurse | ForEach-Object{$_.LastWriteTime = Get-Date}
As i had a hard time finding anything in the mailchimp documentation, i thought it might help a lost soul to put this info here:
If you cannot find your marketing_permission_id of your mailchimp list (eg. for GDPR compliance), you can do a signup request (maybe others too),
using the API, and it will return its data, including the marketing_permissions array containing the unique id for the opt-in.
POST:
{
"email_address": "xxx@xxx.xx",
"status": "subscribed",
"status_if_new": "subscribed",
"merge_fields": {
"FNAME": "John",
window.browserInfo = function() {
// Opera 8.0+
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';
// Safari 3.0+ "[object HTMLElementConstructor]"
var isSafari = /constructor/i.test(window.HTMLElement) ||
(function(p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] ||
(typeof safari !== 'undefined' && safari.pushNotification));
public class DbGamePlayer : ICRUD<GamePlayer>
{
private string CONNECTION_STRING = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
private SqlConnection connection;
public DbGamePlayer()
{
connection = new SqlConnection(CONNECTION_STRING);
}
public void Create(GamePlayer entity)
{
public interface ICRUD<T>
{
void Create(T entity);
T Get(int id);
IEnumerable<T> GetAll();
void Update(T entity);
void Delete(int id);
}
public class GamePlayer
{
@rohansen
rohansen / gist:6396003f213131a642b2a92511419fb7
Created March 23, 2018 09:33
Calling web services with Coroutines
using Assets;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Trivia : MonoBehaviour {
public GameObject plane;
// Use this for initialization
void Start () {
FaucetTest