This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ExecutingOnANewThread() | |
{ | |
//both tasks defined bellow will be executed on a new background thread | |
var task = new Task(() => { }, TaskCreationOptions.LongRunning); | |
task.Start(TaskScheduler.Default); | |
//or | |
var task2 = Task.Factory.StartNew(() => { }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RavenDBExtensions | |
{ | |
public static Lazy<T> FirstOrDefaultLazy<T>(this IQueryable<T> query, Func<T, bool> predicate) | |
{ | |
if (query == null) throw new ArgumentNullException("query"); | |
if (predicate == null) throw new ArgumentNullException("predicate"); | |
return query.Where(x => predicate(x)).FirstOrDefaultLazy(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script edits the project file and marks the talkfx-c.dll files to always be copied to the output directory | |
param($installPath, $toolsPath, $package, $project) | |
# Load project XML. | |
$doc = New-Object System.Xml.XmlDocument | |
$doc.Load($project.FullName) | |
$namespace = 'http://schemas.microsoft.com/developer/msbuild/2003' | |
# Find the node containing the file. The tag "Content" may be replace by "None" depending of the case, check your .csproj file. | |
$talkFXDlls = Select-Xml "//msb:Project/msb:ItemGroup/msb:Content[contains(@Include, 'talkfx-c.dll')]" $doc -Namespace @{msb = $namespace} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$x86TalkFX = $project.ProjectItems.Item("CroccatTalkWrapper").ProjectItems.Item("win32-x86").ProjectItems.Item("talkfx-c.dll"); | |
$x86TalkFX.Properties.Item("BuildAction").Value = [int]2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Package NuGetDebugTools | |
Add-Debugger.ps1 | |
Set-PSBreakpoint -Command init.ps1, install.ps1, uninstall.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define TALKFX_ZONE_AMBIENT 0x00 | |
#define TALKFX_ZONE_EVENT 0x01 | |
#define TALKFX_EFFECT_OFF 0x00 | |
#define TALKFX_EFFECT_ON 0x01 | |
#define TALKFX_EFFECT_BLINKING 0x02 | |
#define TALKFX_EFFECT_BREATHING 0x03 | |
#define TALKFX_EFFECT_HEARTBEAT 0x04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IHaveDeferredEnumerable | |
{ | |
IEnumerable<IHaveDeferredEnumerable> Get(); | |
} | |
public class HasDeferredEnumerable : IHaveDeferredEnumerable | |
{ | |
public IEnumerable<IHaveDeferredEnumerable> Get() | |
{ | |
yield return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DHTSensor.h> | |
DHTSensor sensor(3);//Will be using pin3 for collecting the data | |
void loop() | |
{ | |
DHTSensorMeasurement re = sensor.Read(); | |
if (!re.HasError()) | |
{ | |
Serial.print("H: "); | |
Serial.print(re.Humidity()); | |
Serial.print(" T: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Mosquitto MQTT Broker daemon | |
ConditionPathExists=/etc/mosquitto/mosquitto.conf | |
After=network.target | |
Requires=network.target | |
[Service] | |
Type=forking | |
RemainAfterExit=no | |
StartLimitInterval=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect to a bluetooth speaker | |
sudo bluetoothctl | |
power on | |
pairable on | |
agent on | |
default-agent | |
scan on | |
pair xx:xx:xx:xx:xx:xx | |
trust xx:xx:xx:xx:xx:xx |
OlderNewer