This file contains hidden or 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
namespace ServicesTool2.ViewModel | |
{ | |
using System; | |
using System.DirectoryServices.AccountManagement; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Input; | |
using GalaSoft.MvvmLight; | |
using GalaSoft.MvvmLight.CommandWpf; |
This file contains hidden or 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
:: Guides and examples can be found at: | |
:: http://forums.guru3d.com/showthread.php?t=356046 | |
:: Script needs to be set as a system startup batch file with the highest priority and system privilages to work correctly. | |
:: Init the ramdrive (6GB) in physical memory and format it as ntfs | |
imdisk -a -s 6G -m R: -p "/fs:ntfs /q /y" -o awe | |
:: add a page file starting with 96MB and expands to 1536M | |
swapadd R:\pagefile.sys 96M 1536M |
This file contains hidden or 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
# coding=utf-8 | |
from os import path | |
from time import sleep | |
from urllib.request import urlopen | |
from datetime import datetime | |
from smtplib import SMTP | |
from bs4 import BeautifulSoup | |
DEBUG_TAG = '[{name}]'.format(name=path.basename(__file__)) | |
IP_LOOKUP_URL = 'http://whatismyip.org' |
This file contains hidden or 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
case class City(id: Long, name: String) | |
case class State(id: Long, abbr: String, name: String) | |
def citiesInPostal(postal: Long): DBIO[Seq[(City, State, Long)]] = { | |
sql"""SELECT c.id, c.name, s.id, s.abbr, s.name, csp.id | |
FROM location_identifier AS li, | |
cities AS c, | |
states AS s, | |
city_state_postal AS csp | |
WHERE csp.postal_code = ${postal} |
This file contains hidden or 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
import slick.backend.DatabaseConfig | |
import slick.dbio.{NoStream, Effect} | |
import slick.driver.JdbcProfile | |
import slick.jdbc.JdbcBackend | |
import slick.profile.{SqlStreamingAction, SqlAction} | |
import scala.concurrent.Await | |
import scala.concurrent.duration.Duration | |
import scala.io.Source |
This file contains hidden or 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
package Extensions | |
import dispatch._ | |
import slick.dbio.{NoStream, Effect} | |
import slick.jdbc.JdbcBackend | |
import slick.profile.{SqlAction, SqlStreamingAction} | |
import scala.concurrent.Await | |
import scala.concurrent.duration.Duration |
This file contains hidden or 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
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System.ServiceProcess; | |
using System.Linq; | |
using Microsoft.QualityTools.Testing.Fakes; | |
using Ploeh.AutoFixture; | |
using Ploeh.AutoFixture.AutoMoq; | |
using ServicesTool2.Models; | |
namespace ServicesToolTests { |
This file contains hidden or 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
var haystack = "AABBCC"; | |
var matches = rules.Where(kv => haystack.Contains(kv.Key)).ToDictionary(kv => kv.Key, kv => kv.Value); | |
var needle = matches.Any() ? matches.ElementAt(new Random().Next(matches.Count)).Key : ""; | |
haystack.Replace(needle, rules[needle]); |
This file contains hidden or 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
#!/usr/local/bin/perl -w | |
use strict; | |
use IO::Socket::INET; | |
use Sys::Hostname; | |
use Data::Dumper; | |
my ($remote_host, $remote_port); | |
$remote_port = $ARGV[0]; | |
my $hostname = `hostname`; |
This file contains hidden or 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
class MainActivity extends BaseActivity { | |
private lazy val signalStr : PhoneStateListener = onSignalChanged((signalStrength) ⇒ { | |
if (signalStrength != null) { | |
lazy val signalWrapper = new SignalArrayWrapper(signalStrength.toString) | |
filteredSignals = signalWrapper.filterSignals(signalStrength.toString) | |
displayDebugInfo(signalWrapper) | |
displaySignalInfo(filteredSignals) | |
} | |
}) |