Skip to content

Instantly share code, notes, and snippets.

from __future__ import print_function
sign = "*"
empty = " "
max = 45
height = 3
space = 5
print()
# candle
for i in range(0,3):
static void Main(string[] args)
{
string sign = "*";
string empty = " ";
string heart = "*";
int max = 45;
int height = 3;
int space = 5;
Console.WriteLine();
@eternaltung
eternaltung / ConnectorClientChannelData.cs
Created October 20, 2016 11:41
Bot Framework ConnectorClient ChannelData Sample
var msg = new Activity()
{
Type = ActivityTypes.Message,
From = botAccount,
ChannelId = "facebook",
Recipient = userAccount,
Conversation = new ConversationAccount(id: conversationId.Id),
ChannelData = JObject.FromObject(new
{
attachment = new
@eternaltung
eternaltung / BotConnectorClientSample.cs
Last active January 13, 2021 08:43
Bot Framework ConnectorClient Sample
Task.Run(async () =>
{
string appID = "id";
string appPW = "pw";
ChannelAccount botAccount = new ChannelAccount(name: "bot name", id: "");
ChannelAccount userAccount = new ChannelAccount(name: "user name", id: "");
var serviceUri = new Uri("https://facebook.botframework.com");
var connector = new ConnectorClient(serviceUri, appID, appPW);
MicrosoftAppCredentials.TrustServiceUrl(serviceUri.AbsoluteUri);
@eternaltung
eternaltung / MultiSelect.aspx
Created February 27, 2016 08:16
Asp.net Web Forms Bootstrap MultiSelect
<script type="text/javascript">
$(document).ready(function () {
$('#<%=ListBox1.ClientID%>').multiselect({
includeSelectAllOption: true,
allSelectedText: 'All Selected',
enableFiltering: true,
filterPlaceholder: 'Search...'
});
});
</script>
@eternaltung
eternaltung / MultiSelect.aspx.cs
Created February 27, 2016 08:11
Asp.net Web Forms Bootstrap MultiSelect
protected void Button1_Click(object sender, EventArgs e)
{
var query = ListBox1.Items.Cast<ListItem>().Where(x => x.Selected).Select(y => y.Text).ToArray();
Label1.Text = string.Join(",",query);
}
@eternaltung
eternaltung / MultiSelect.aspx
Created February 27, 2016 08:08
Asp.net Web Forms Bootstrap MultiSelect
<head runat="server">
<title>Sample</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" type="text/css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#<%=ListBox1.ClientID%>').multiselect();
@eternaltung
eternaltung / MultiSelect.aspx
Created February 27, 2016 08:04
Asp.net Web Forms Bootstrap MultiSelect
<asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple">
<asp:ListItem Text="Item1" Value="1" />
<asp:ListItem Text="Item2" Value="2" />
<asp:ListItem Text="Item3" Value="3" />
<asp:ListItem Text="Item4" Value="4" />
</asp:ListBox>
<asp:Button ID="Button1" runat="server" Text="Show Select" OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
using System.Collections.Generic;
using System.Windows;
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Height="47" Margin="110,63,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="159"/>