Skip to content

Instantly share code, notes, and snippets.

View dmp1ce's full-sized avatar
😃
Enjoying life

David dmp1ce

😃
Enjoying life
View GitHub Profile
FROM dmp1ce/php-fpm-drupal:5
RUN apt-get -yq update
RUN apt-get -yq install --no-install-recommends rsync
@dmp1ce
dmp1ce / disable-ForceFullCompositionPipeline.sh
Created January 11, 2017 01:38
Disable the forced vsync script
#!/bin/sh
# https://www.gamingonlinux.com/articles/i-have-finally-found-a-way-to-sort-out-screen-tearing-on-nvidia-with-linux.7213/page=7#comments
sh -c "nvidia-settings --assign CurrentMetaMode=\"$(nvidia-settings -t -q CurrentMetaMode |tr -d "\n"|sed 's/.*:://'|sed 's/^ *//;s/ *$//')\""
@dmp1ce
dmp1ce / ForceFullCompositionPipeline.sh
Created January 11, 2017 01:35
Force vsync on Linux
#!/bin/sh
# https://www.gamingonlinux.com/articles/i-have-finally-found-a-way-to-sort-out-screen-tearing-on-nvidia-with-linux.7213/page=7#comments
sh -c "nvidia-settings --assign CurrentMetaMode=\"$(nvidia-settings -t -q CurrentMetaMode |tr -d "\n"|sed 's/ViewPortIn=/ForceFullCompositionPipeline=On, ViewPortIn=/g'|sed 's/.*:://'|sed 's/^ *//;s/ *$//')\""
@dmp1ce
dmp1ce / Dockerfile
Last active July 31, 2016 18:14
Katy Playlist Creator - Coder Radio Challenge for Episode #215
FROM haskell
MAINTAINER /u/dmp1ce
# Install requirements for katy_playlist.hs
RUN cabal update && cabal install hoauth2
@dmp1ce
dmp1ce / blackjack.hs
Last active July 21, 2016 16:30
Suggest next move for Blackjack - Coder Radio Challenge for Episode #214
#!/usr/bin/env runhaskell
-- Coder Radio Challenge for Episode #214
-- https://www.reddit.com/r/CoderRadio/comments/4t7oyt/episode_214_coding_challenge/
-- To run make this file executable and run ./blackjask.hs
-- runhaskell and ghci are required
-- This program considers a players hand which can be more one or more cards
-- containing one ore more Aces.
-- | A library to do stuff.
module Lib
(
ourAdd
, fun1
, fun1'
, fun2
, fun2'
) where
module LibSpec where
import Test.Hspec
import Test.Hspec.QuickCheck
import Lib (ourAdd,fun1,fun2,fun1',fun2')
main :: IO ()
main = hspec spec
--skipAt :: Int -> [a] -> [[a]]
--skipAt n (x:xs)
-- | length xs > n = [[x]] ++ (skipAt n xs)
-- | length xs <= n = [[x]]
-- | n < 0 = [(x:xs)]
-- | otherwise = skipAt (n-1) xs
-- Working solution
skipAt :: Int -> [a] -> [[a]]
skipAt n ls
@dmp1ce
dmp1ce / vultr-ubuntu-15.04-configure
Last active December 19, 2021 17:47
Configure Ubuntu 15.04 for docker-compose and decompose on Vultr.com
#!/bin/bash
# To run from shell:
# bash <(curl -sSL https://gist.githubusercontent.com/dmp1ce/84c31085745101f8c241/raw)
do_config() {
# Make sure to run as root
user="$(id -un 2>/dev/null || true)"
if [ "$user" != 'root' ]; then
$ (git clone https://github.com/dmp1ce/decompose) 2>&1 >/dev/null
Cloning into 'decompose'...
remote: Counting objects: 190, done.
remote: Total 190 (delta 0), reused 0 (delta 0), pack-reused 190
Receiving objects: 100% (190/190), 31.33 KiB | 0 bytes/s, done.
Resolving deltas: 100% (96/96), done.
Checking connectivity... done.