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
| jQuery.noConflict(); | |
| (function() { | |
| var $ = this.jQuery, | |
| MyNamespace = {}; | |
| MyNamespace.SuperAwesomeFunction = function() { | |
| //do awesome stuff | |
| }; | |
| $(function() { | |
| MyNamespace.SuperAwesomeFunction(); |
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
| Fluently.Configure() | |
| .Database(MsSqlConfiguration.MsSql2008.ConnectionString("server=.\\SQLEXPRESS;database=NH3BeginnersGuide;Integrated Security=SSPI")) | |
| .Mappings(m => m.FluentMappings.AddFromAssemblyOf<SessionFactoryProvider>()) | |
| .ExposeConfiguration((cfg) => { | |
| var schemaExport = new SchemaExport(cfg); | |
| schemaExport.Drop(false, true); | |
| schemaExport.Create(false,true); | |
| }) | |
| .BuildConfiguration() | |
| .CurrentSessionContext<ThreadStaticSessionContext>() |
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
| void Main() | |
| { | |
| //Create Session Provider With CurrentSessionContext | |
| var provider = new SessionFactoryProvider<ThreadStaticSessionContext>( | |
| MsSqlConfiguration.MsSql2008.ConnectionString("server=.\\SQLEXPRESS;database=NH3BeginnersGuide;Integrated Security=SSPI"), | |
| typeof(SessionFactoryProvider<>), | |
| (cfg) => { | |
| var schemaExport = new SchemaExport(cfg); | |
| schemaExport.Drop(false, true); | |
| schemaExport.Create(false,true); |
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
| open System; | |
| open System.IO; | |
| open Microsoft.FSharp.Collections; | |
| //setup the watcher and events | |
| let watcher = new FileSystemWatcher(@"C:\Users\brians\Python") | |
| let logFileInfo (args:FileSystemEventArgs) = Console.WriteLine(args.Name) | |
| let events = [watcher.Changed; watcher.Created; watcher.Deleted] |> List.iter(fun e -> e.Add(logFileInfo)) | |
| //read from console |
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
| void Main() | |
| { | |
| var f = new DogBuilder(); | |
| f.GetInstance().Dump(); | |
| } | |
| // Define other methods and classes here | |
| public class Dog : Entity<Dog> | |
| { | |
| public string Name {get;set;} |
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
| open System; | |
| open System.IO; | |
| open Microsoft.FSharp.Collections; | |
| open System.Diagnostics; | |
| let projectDirectory = Directory.GetCurrentDirectory() | |
| let args = Environment.GetCommandLineArgs(); | |
| let watcher = new FileSystemWatcher(projectDirectory) |
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
| function isMobileDevice() | |
| { | |
| var agent = navigator.userAgent.toLowerCase(); | |
| var otherBrowser = (agent.indexOf("series60") != -1) || (agent.indexOf("symbian") != -1) || (agent.indexOf("windows ce") != -1) || (agent.indexOf("blackberry") != -1); | |
| var mobileOS = typeof orientation != 'undefined' ? true : false; | |
| var touchOS = ('ontouchstart' in document.documentElement) ? true : false; | |
| var iOS = (navigator.platform.indexOf("iPhone") != -1) || | |
| (navigator.platform.indexOf("iPad") != -1) ? true : false; | |
| var android = (agent.indexOf("android") != -1) || (!iOS && !otherBrowser && touchOS && mobileOS) ? true : false; |
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
| (for(i <- 1 to 999 if(i % 3 == 0 || i % 5 == 0)) yield i) reduceLeft(_ + _) |
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
| def get(fbid: String):Option[FacebookObject] = { | |
| val response = graphFetch(fbid) | |
| response().map(jstr => { | |
| val js = jstr.asJson.asJsObject | |
| val obj = js.convertTo[FacebookObject] | |
| val comments = js.getFields("comments") | |
| if (comments.isEmpty) obj else build(obj, comments.head.asJsObject.convertTo[CommentsJson]) | |
| }) | |
| } |
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
| #!/bin/bash | |
| mkdir -p src/main/{resources,scala} | |
| mkdir -p "src/test/"{resources,scala} | |
| mkdir -p src/it/{resources,scala} | |
| mkdir project | |
| #create project files | |
| echo "sbt.version=0.11.3" > project/build.properties | |
| echo -e 'resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"\n' > project/plugins.sbt | |
| echo 'addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0-SNAPSHOT")' >> project/plugins.sbt |