Skip to content

Instantly share code, notes, and snippets.

{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}{\f3\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}
{\*\listtable
{\list\listtemplateid1\listhybrid
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid5\'01\'b7}{\levelnumbers;}\fi-360\li720\lin720\jclisttab\tx720}
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid6\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1440\lin1440\jclisttab\tx1440}
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid7\'02\'02.;}{\levelnumbers\'01;}\fi-360\li2160\lin2160\jclisttab\tx2160}
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid8\'02\'03.;}{\levelnumbers\'01;}\fi-360\li2880\lin2880\jc
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
$('.typeahead').typeahead({
});
$('.group').on('change', function (e) {
if (e.target.value == "") {
return;
}
$('.typeahead').typeahead({
});
$('.group').focusout(function (e) {
if (e.target.value == "") {
return;
}
@andySF
andySF / gist:3626010
Created September 4, 2012 20:20
ruby installed programs
Program.transaction do
Program.update_all({:Installed=>FALSE}, {:machine_id=>params[:machine_id]})
params[:programs][:program].each do |t|
if(Program.exists?(:DisplayName=>t[:DisplayName], :Version=>t[:Version], :machine_id=>t[:machine_id]))
Program.where(:DisplayName=>t[:DisplayName], :Version=>t[:Version], :machine_id=>t[:machine_id]).update_all :Installed=>TRUE
else
Program.create(t)
end
end
end
@andySF
andySF / gist:3626003
Created September 4, 2012 20:20
.net installed programs
if (Request.ContentType == Common.ContentTypeAsXml)
{
//Rails logic:
//mark all programs for this machine to installed=false
//then for each program if exists mark installed as true
//else add
var installedProgramsXML = new StreamReader(Request.InputStream).ReadToEnd();
using System;
namespace IONService.Config
{
class Variables
{
//app
static public string IONServiceServiceName = "IONService";
using System;
namespace IONService.Config
{
class Variables
{
//app
static public string IONServiceServiceName = "IONService";
<div class="modal hide" id="deleteMachine" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
×
</button>
<h3>Machine Deletion</h3>
</div>
<div class="modal-body">
Are you sure that you want to delete this machine? <%= @current_machine_id%>
{<?xml version="1.0" encoding="utf-8"?>
<applications>
<application>
<DisplayName />
<Publisher />
<InstallDate />
<Version />
<UninstallString />
</application>
<application>