Skip to content

Instantly share code, notes, and snippets.

View swlasse's full-sized avatar

Lasse Christiansen swlasse

  • Amazon Web Services
  • Kävlinge, Sweden
  • X @sw_lasse
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;
@rstackhouse
rstackhouse / gist:1162357
Created August 22, 2011 13:22
Configure NLog Programmatically
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;
using NLog.Common;
using NLog.Targets;
using NLog.Config;
namespace ConsoleApplication1
@gbishop
gbishop / iPadAudio
Created December 21, 2011 20:04
Play sound on the iPad from Javascript using jquery mobile
I keep forgetting how to do this...
To play audio in Safari on the iPad using javascript you have to create the audio node in response to a user event. You have to give the audio node a legal url and call load. Then reuse that same node to play sounds in the future.
In jquery mobile I bound to the 'tap' event on body. If I haven't already created the audio object I create it there. Then I can use it later.
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@mluton
mluton / gist:3990658
Created October 31, 2012 23:37
Display UIActivityViewController in a Popover
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"something"] applicationActivities:nil];
self.popover = [[UIPopoverController alloc] initWithContentViewController:activityViewController];
self.popover.delegate = self;
[self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
@thomaspark
thomaspark / subnav.css
Last active June 6, 2023 10:19
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
@drub0y
drub0y / DispatcherTaskScheduler.cs
Last active December 2, 2022 15:36
A .NET TPL TaskScheduler implementation that spins up STA threads running a Dispatcher message pump which enables the execution of logic that leverage System.Windows.* components. Why? Well, without this, the use of System.Windows.* components will create a new Dispatcher instance on the currently executing thread and since that thread is a) not…
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Collections.Concurrent;
using System.Windows.Threading;
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@jespereneberg
jespereneberg / One import via join.yaml
Last active May 25, 2020 09:31
Fn::ImportValue from other stacks
Tags:
- Key: Name
Value:
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]]
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2