Skip to content

Instantly share code, notes, and snippets.

View SjB's full-sized avatar

Steve Beaulac SjB

  • London Ontario Canada
View GitHub Profile
@SjB
SjB / build.cake
Last active September 23, 2015 17:50
Package function
Action<DirectoryPath, FilePath> Package = delegate(DirectoryPath path, FilePath zipfile) {
Information("Package: {0} into {1}", path.ToString(), zipfile.ToString());
if (IsRunningOnUnix()) {
var processArgs = new ProcessArgumentBuilder();
processArgs.Append("-r");
processArgs.Append(zipfile.ToString());
processArgs.Append(".");
var wd = (Directory(path.ToString()));
Information(wd.ToString());
StartProcess("zip", new ProcessSettings { WorkingDirectory = wd, Arguments = processArgs });
@SjB
SjB / build.cake
Last active October 23, 2015 16:25
fetch an archive and extract it in the path specified
Action<string, string> FetchDependent = delegate(string file, string path) {
var dslmioLibDir = thirdPartyLibDir + Directory(path);
if (!DirectoryExists(dslmioLibDir)) {
Information(file);
var tempFile = DownloadFile(file);
Information(tempFile.ToString());
if (file.EndsWith("zip")) {
Unzip(tempFile, thirdPartyLibDir);
@SjB
SjB / build.cake
Last active October 23, 2015 16:22
Cake Tar function
Action<FilePath, DirectoryPath> Tar = delegate(FilePath src, DirectoryPath dst) {
Information("tar xf {0} -C {1}", src.ToString(), dst.ToString());
var processArgs = new ProcessArgumentBuilder();
processArgs.Append("-C {1} -x -f {0} ", src.ToString(), dst.ToString());
StartProcess("tar", new ProcessSettings { Arguments = processArgs });
};
@SjB
SjB / build.cake
Last active October 23, 2015 16:21
Cake FindDirectory function
Func<string, DirectoryPath> FindDirectory = delegate(string glob) {
var dirs = GetDirectories(glob);
foreach (var dir in dirs)
return dir;
Error("Can't find any file with glob {0}", glob);
return Directory("");
};
@SjB
SjB / .editorconfig.txt
Last active October 23, 2015 16:20
editorconfig template for package.json and javascript
root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
@SjB
SjB / gcal-sync.el
Last active February 24, 2026 04:41
sync google calendar into emacs diary
;;; gcal-sync.el --- import google calendar into our dairy -*- lexical-binding: t; -*-
;; Copyright (C) 2016 Steve Beaulac
;; Author: Steve Beaulac <steve@sagacity.ca>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
(defun dired-find-file-below ()
"Displays file at point in a new window below current"
(interactive)
(display-buffer-below-selected (find-file-noselect (dired-get-file-for-visit)) nil))
(define-key dired-mode-map (kbd "C-o") 'dired-find-file-below)
#include "process_keycode/process_tap_dance.h"
#include "action.h"
#include "action_layer.h"
#include "action_util.h"
#include "quantum.h"
#include "wait.h"
#define TD_PRESSED_EVENT 0xFF
#define ACTION_TAP_DANCE_MOD_TAP(kc1, kc2) { \
@SjB
SjB / update-alternatives-clang-format
Last active May 1, 2018 18:48
command to insert clang-format to alternative list
sudo update-alternatives \
--install /usr/bin/clang-format clang-format /usr/bin/clang-format-6.0 60 \
--slave /usr/bin/clang-format-diff clang-format-diff /usr/bin/clang-format-diff-6.0 \
--slave /usr/share/man/man1/clang-format.1.gz clang-format.1.gz /usr/share/man/man1/clang-format-6.0.1.gz \
--slave /usr/share/man/man1/clang-format-diff.1.gz clang-format-diff.1.gz /usr/share/man/man1/clang-format-diff-6.0.1.gz
using Cake.Core;
using Cake.Core.Polyfill;
using Cake.Core.IO.Arguments;
public class Protobuild
{
private static readonly string protobuildUrl = "https://github.com/hach-que/Protobuild/raw/master/Protobuild.exe";
private static readonly FilePath protobuild = new FilePath("Protobuild.exe");