find /path/to/files* -mtime +5 -exec rm {} ;
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
| //this is not a pure function because it has a 'hidden input' of the current date. | |
| function addDay(days) { | |
| var currentDate = new Date(); | |
| return currentDate.setDate(currentDate.getDate() + days); | |
| } | |
| //this is not a pure function because it has a 'hidden output' of the times called. | |
| var timesCalled = 0; | |
| function addDay(days, currentDate) { |
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; |