View shirt_fetcher.ex
This file contains 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 ShirtFetcher do | |
import Meeseeks.CSS | |
@output_dir "woman_shirts" | |
def fetch(url) do | |
root = URI.parse(url) | |
document = HTTPoison.get!(url) | |
links = Meeseeks.all(document.body, css("div.itemWrap > a")) | |
urls = for anchor <- links, href = Meeseeks.Result.attr(anchor, "href"), do: URI.merge(root, href) |> to_string() |
View OverridenFormatter.swift
This file contains 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
/* | |
* Code to my question http://stackoverflow.com/questions/37448249/propagating-base-class-errors-in-swift | |
* I don't understand why there's such a difference in these two Formatters behavior | |
*/ | |
import Cocoa | |
class OverridenFormatter: NSNumberFormatter { | |
override func getObjectValue(obj: AutoreleasingUnsafeMutablePointer<AnyObject?>, forString string: String, range rangep: UnsafeMutablePointer<NSRange>) throws { | |
// not doing anything, just delegating to the base class | |
try super.getObjectValue(obj, forString: string, range: rangep) |
View Funktemplater.fs
This file contains 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 DocumentFormat.OpenXml; | |
open DocumentFormat.OpenXml.Packaging; | |
open DocumentFormat.OpenXml.Wordprocessing; | |
[<Literal>] | |
let openingBracket = "<#" | |
[<Literal>] | |
let closingBracket = "#>" |
View combinations.fsx
This file contains 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
(* | |
* F# Implementation of the combinations generator, based on the series "Producing combinations" by Eric Lippert | |
* - http://ericlippert.com/2014/10/13/producing-combinations-part-one/ | |
* - ... | |
* - http://ericlippert.com/2014/10/27/producing-combinations-part-five/ | |
*) | |
open System.Collections | |
open System.Collections.Generic | |
module List = |
View gist:ace7924025c3d5485090
This file contains 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 isCustomObject(obj) { | |
var result = obj && Object.prototype.toString.call(obj) == '[object Object]'; | |
return result; | |
} | |
function deepOmit(obj) { | |
var newEntity = _.transform(obj, function(result, value, key) { | |
console.log(value.constructor.name); | |
var isParentProperty = String(key).toLowerCase().indexOf("parent") >= 0; | |
if (!isParentProperty) { |
View NaryTreeStateMonad
This file contains 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 | |
type Tree<'a> = | |
| Leaf of 'a | |
| Branch of Tree<'a> list | |
type StateMonad<'state, 'content> = StateMonad of ('state -> ('state * 'content)) | |
let testTree = | |
Branch [ |
View gist:10934747
This file contains 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; | |
module StateMonad = | |
let (>>=) x f = (fun s0 -> | |
let a,s = x s0 | |
f a s) | |
let kwik = (>>=) | |
let returnS a b = a, b |
View ConEmu.CtrAltN.lua
This file contains 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
local ConEmu = "4b675d80-1d4a-4ea9-8436-fdc23f2fc14b" | |
local function RunTask(TaskName) | |
callString = string.gsub("Task(\"" .. TaskName .. "\",\"" .. APanel.Path .. "\")", "\\", "\\\\"); | |
Plugin.Call(ConEmu, callString) | |
end | |
Macro { area="Shell"; key="CtrlAlt1"; action = function() RunTask("VSConsole") end; } | |
Macro { area="Shell"; key="CtrlAlt2"; action = function() RunTask("Powershell") end; } |
View ProjectPropertyWriter.cs
This file contains 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.IO; | |
using System.Linq; | |
using Microsoft.Build.Construction; | |
using Microsoft.Build.Framework; | |
using Microsoft.Build.Utilities; | |
namespace EldSharp.Scripts.MsBuild | |
{ | |
public sealed class ProjectPropertyWriterTask : Task | |
{ |