Skip to content

Instantly share code, notes, and snippets.

View freeman42x's full-sized avatar
🎯
Twitch streaming work on open source projects, looking for contributors

freeman42x freeman42x

🎯
Twitch streaming work on open source projects, looking for contributors
View GitHub Profile
@freeman42x
freeman42x / gist:5420640
Created April 19, 2013 14:18
Glimpse configuration required for ASP.NET WebForms AJAX
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<runtimePolicies>
<contentTypes>
<!-- content type of the ajax request response that needs to be logged -->
<add contentType="text/plain"/>
</contentTypes>
</runtimePolicies>
</glimpse>
@freeman42x
freeman42x / Main.hs
Created April 26, 2016 23:46
Pangram
import Data.Char
import Data.List
isPangram :: String -> Bool
isPangram s = (sort . nub . filter isLetter $ map toLower s) == ['a'..'z']
main :: IO ()
main = do
s <- getLine
putStrLn $ if isPangram s
[neo@nixos:~/Sources/miso/sample-app]$ nix-shell -A env
error: attribute 'env' in selection path 'env' not found
[neo@nixos:~/Sources/miso/sample-app]$
[neo@nixos:~/Sources/miso]$ cat ~/.config/nixpkgs/config.nix
/* { allowUnfree = true; } */
{
allowUnfree = true;
packageOverrides = super: let self = super.pkgs; in
{
profiledHaskellPackages = self.haskellPackages.override {
overrides = self: super: {
mkDerivation = args: super.mkDerivation (args // {
@freeman42x
freeman42x / run.py
Created April 5, 2019 15:40
One Hot Gym Prediction using getScalarMetricWithTimeOfDayAnomalyParams
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License version 3 as
# published by the Free Software Foundation.
#
iproute-1.7.7: copy/register
HTTP-4000.3.13: copy/register
regex-tdfa-1.2.3.1: copy/register
haskell-src-exts-1.21.0: copy/register
Progress 27/84
-- While building package hstatsd-0.1 using:
/home/neo/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /home/neo/Forks/lambdabot/.stack-work/logs/hstatsd-0.1.log
Progress 8/54
-- While building package network-bsd-2.8.0.0 using:
/home/neo/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-2.4.0.1 configure --with-ghc=/nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc --with-ghc-pkg=/nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/neo/.stack/snapshots/x86_64-linux-nix/lts-13.19/8.6.4/pkgdb --package-db=/home/neo/Forks/lambdabot/.stack-work/install/x86_64-linux-nix/lts-13.19/8.6.4/pkgdb --libdir=/home/neo/Forks/lambdabot/.stack-work/install/x86_64-linux-nix/lts-13.19/8.6.4/lib --bindir=/home/neo/Forks/lambdabot/.stack-work/install/x86_64-linux-nix/lts-13.19/8.6.4/bin --datadir=/home/neo/Forks/lambdabot/.stack-work/install/x86_64-linux-nix/lts-13.19/8.6.4/share --libexecdir=/home/neo/Forks/lambdabot/.stack-work/install/x86_64-linux-nix/lts-13.19/8.6.4/libexec --sysconfdir=/
@freeman42x
freeman42x / gist:a8c1ca73682c19330f80a001d343e52c
Created August 19, 2019 11:04
how to add unstable correctly to config.nix
{
allowUnfree = true;
packageOverrides = pkgs_: {
unstable = import <nixpkgs-unstable> {
# pass the nixpkgs config to the unstable alias
# to ensure `allowUnfree = true;` is propagated:
config = config.nixpkgs.config;
};
let jdk = openjdk11; in {
@freeman42x
freeman42x / shell.nix
Last active August 19, 2019 17:22
How to add nix package with executable that can be used from nix-shell?
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, hedgehog, hedgehog-fn, hint, hpack
, placeholders, stdenv, template-haskell
}:
mkDerivation {
[neo@nixos:~/Projects/fairy-tale-artificial-general-intelligence-solutions/Sources/Razvan Flavius Panda/Haskell/artificial-general-intelligence]$ stack build
Executable named nix-shell not found on path: ["/nix/store/mn4jdnhkz12a6yd6jg6wvb4mqpxf8q1f-bash-interactive-4.4-p23/bin","/nix/store/92ra786kma8vpm2hklfypsjai9m7ra7l-ghc-8.6.4-with-packages/bin","/nix/store/gvshp9yvc6gql09r3cyryj2zgsnfk6br-ghc-8.6.4/bin","/nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0/bin","/nix/store/d4n93jn9fdq8fkmkm1q8f32lfagvibjk-gcc-7.4.0/bin","/nix/store/f5wl80zkrd3fc1jxsljmnpn7y02lz6v1-glibc-2.27-bin/bin","/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/bin","/nix/store/rbpyfy6413aqpik9aj6p3a2syd1mda68-binutils-wrapper-2.31.1/bin","/nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin","/nix/store/f5wl80zkrd3fc1jxsljmnpn7y02lz6v1-glibc-2.27-bin/bin","/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/bin","/nix/store/mym79p27mpwc9ll22xfvchb3pizy4khw-remove-references-to/bin","/nix/store