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
# install needed libraries | |
sudo yum install texinfo libXpm-devel giflib-devel libtiff-devel libotf-devel | |
# compile autoconf | |
cd /tmp | |
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2 | |
tar xjvf autoconf-2.68.tar.bz2 | |
cd autoconf-2.68/ | |
./configure && make && sudo make install |
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
defmodule Image do | |
@moduledoc false | |
use Ecto.Model | |
@primary_key {:Id, :binary_id, autogenerate: false} | |
schema "Images" do | |
field :name | |
field :extension | |
field :path | |
end |
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
defmodule Foo.BarController do | |
use Foo.Web, :controller | |
defmodule ByKeyParams do | |
defstruct dob: "", last_name: "", request_id: "" | |
end | |
def by_key(conn, params) do | |
params = %ByKeyParams{} |> map.merge(params) | |
request = %Foo.Request{} |
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
#if INTERACTIVE | |
#r "../../packages/Selenium.WebDriver.2.48.2/lib/net40/WebDriver.dll" | |
#r "../../packages/Selenium.Support.2.48.2/lib/net40/WebDriver.Support.dll" | |
#r "../../packages/Newtonsoft.Json.6.0.6/lib/net40/Newtonsoft.Json.dll" | |
#r "../../packages/SizSelCsZzz.0.3.36.0/lib/SizSelCsZzz.dll" | |
#r "../../src/canopy/bin/Debug/canopy.dll" | |
#endif |
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
CREATE view [dbo].[vw_TablePrimaryKeys] | |
AS | |
/* | |
---------------------------------------------------------------------------- | |
View: [vw_TablePrimaryKeys] | |
Description: Returns PK information for all tables | |
---------------------------------------------------------------------------- | |
Who When Why | |
--------- --------- --------- |
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
sam.before({}, function () { | |
var cancel = false; | |
if (vm.LastLocation) { | |
cancel = vm.LastLocation !== window.location.pathname; | |
} | |
vm.LastLocation = window.location.pathname; |
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
ko.extenders.precisionScale = function (target, dynamicProperty) { | |
//create a writable computed observable to intercept writes to our observable | |
var result = ko.pureComputed({ | |
read: target, //always return the original observables value | |
write: function (newValue) { | |
var current = target(); | |
var valueToWrite = newValue; | |
if (valueToWrite) { |
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
public class FakePage<T> : List<T> , IPagedList<T> | |
{ | |
public FakePage(int page, int pageSize, int totalRecords, IEnumerable<T> collection ) : base(collection) | |
{ | |
this.PageCount = (totalRecords + pageSize -1 ) / pageSize; | |
this.TotalItemCount = totalRecords; | |
this.PageNumber = page; | |
this.PageSize = pageSize; | |
this.HasPreviousPage = page > 1; |
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
//a class that has a parent id and contains a list of children | |
public class Folder { | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public int? ParentId { get; set; } | |
public List<Folder> Children { get; set; } | |
public int Level { 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
//unmodified | |
var original = new List<Person>() { | |
new Person() { Id = 1, Name = "Bryan" }, | |
new Person() { Id = 2, Name = "Randy" }, | |
new Person() { Id = 3, Name = "Jill" } }; | |
//modified | |
var updated = new List<Person>() { | |
new Person() { Id = 1, Name = "Bryan" }, | |
new Person() { Id = 2, Name = "Randi" }, //Update Randy to Randi |