Skip to content

Instantly share code, notes, and snippets.

@dtasev
dtasev / 11 OCT 2019 - 17 SEP 2018
Last active October 11, 2019 09:08
Mantid File Extensions count
File differences 11 OCT 2019 - 17 SEP 2018
h +363
cpp +161
rst +161
py +618
md5 +316
png +187
xml +65
txt +42
ui +32
@matthew-d-jones
matthew-d-jones / clangformat-precommit-hook
Last active July 24, 2017 09:27
A git pre-commit hook to reject changes which would result in non clang-formatted files
#!/bin/sh
#
# This pre-commit hook checks if any versions of clang-format
# are installed, and if so, uses the installed version to reject
# un-clang-formatted commits
maj_min=1
maj_max=3
base=clang-format
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active June 8, 2025 17:38
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@robbintt
robbintt / gulpfile.js
Last active April 5, 2019 07:20 — forked from gabrielhpugliese/gulpfile.js
Django collectstatic + Gulp watch
var gulp = require('gulp');
// Run shell commands with exec:
// https://www.npmjs.com/package/gulp-exec
var exec = require('child_process').exec;
// collectstatic task for Django
// https://www.npmjs.com/package/gulp-exec
gulp.task('collectstatic', function (cb) {
exec('python ../../manage.py collectstatic -i node_modules -i bower_components --noinput', function (err, stdout, stderr) {
@bryanbarnard
bryanbarnard / SimpleHttpClient.cs
Created December 23, 2013 19:15
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
@0xF1o
0xF1o / gist:4179759
Created December 1, 2012 00:30
win32 GetLastInputInfo C# example
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace GetLastUserInput
{
public class GetLastUserInput
{
private struct LASTINPUTINFO
{
@ndarville
ndarville / settings.py
Last active December 16, 2024 16:14
Django on Travis CI
"""A basic database set-up for Travis CI.
The set-up uses the 'TRAVIS' (== True) environment variable on Travis
to detect the session, and changes the default database accordingly.
Be mindful of where you place this code, as you may accidentally
assign the default database to another configuration later in your code.
"""
import os