Skip to content

Instantly share code, notes, and snippets.

import std.traits : isIntegral, isUnsigned, Unqual;
/**
*/
pure @safe nothrow @nogc
{
int pow(int lhs, uint rhs, ref bool overflow)
{ return powImpl(lhs, rhs, overflow); }
/// ditto
long pow(long lhs, uint rhs, ref bool overflow)
@veelo
veelo / howto.md
Last active September 27, 2018 01:03
ddox on Travis CI

Serve ddox documentation on github.io deployed by Travis CI

This guide makes no assumptions on prior knowledge of Github Pages or Travis CI. You'll know which steps to skip (if the project uses Pages already, this will overwrite them). Assumed is you have a public D project on GitHub and you have documented its API with embedded ddoc comments. You should probably be aware of the known issues of ddox, which we use here.

For a project URL like https://github.com/<user>/<project>, the documentation will appear at https://<user>.github.io/<project>/.

Enable Travis CI for your repository

The long story: https://docs.travis-ci.com/user/getting-started/, https://docs.travis-ci.com/user/languages/d/

The short story:

@ximion
ximion / dlang-quirks.md
Last active February 18, 2019 19:21
D Issue List

D Issue List

This is a list of issues I encounter when working with the D programming language, and which I find annoying or which limit what I can do with D.

The selection of these issues is completely subjective, I keep it here for personal reference and possibly for others who might want to fix one of these problems or just want to know about the problems I see with D.

Despite all of the issues, I think D is a useful language, otherwise I wouldn't use it and put effort

module buffered_range;
import std.algorithm, std.conv, std.exception, std.range, std.traits, std.typecons;
import core.memory, core.stdc.stdlib;
/*
* Adds the save function to an input range thus promoting
* it to a forward range. This is done by buffering the input range
* in blocks of size blockSize.
*/
@vojtajina
vojtajina / all-templates.html
Created August 15, 2012 00:00
AngularJS: load all templates in one file
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@MartinNowak
MartinNowak / release.sh
Last active October 17, 2022 12:29
Orchestration for dlang release building
#!/usr/bin/env bash
set -ueo pipefail
set -x
ROOT="$PWD"
LATEST_D_VER=v$(curl -fsS http://downloads.dlang.org/releases/LATEST)
BUILD_LDC_VER=v1.30.0
D_VER=v2.101.0-beta.1
@MartinNowak
MartinNowak / BvSshServer-Settings.wst
Last active April 14, 2023 03:52
Preparing a Win7x64 base box.
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>