Skip to content

Instantly share code, notes, and snippets.

Avatar
🌞

Dean Clatworthy deanc

🌞
View GitHub Profile
@deanc
deanc / veracrypt.md
Created Aug 21, 2020
Veracrypt (Truecrypt) CLI set permissions for NTFS mount
View veracrypt.md

If you are having permissions problems (I feel bad for you son...) with your mounted veracrypt volumes when using NTFS there is a simple solution when using the CLI.

Mount like so: veracrypt --truecrypt -t -k "" --pim=0 --protect-hidden=no --fs-options=umask=022 /dev/sdb1 /mnt/yourvolume

Replace sdb1 at whatever your drive path is of course.

@deanc
deanc / use-auth.jsx
Last active Dec 30, 2019 — forked from gragland/use-auth.jsx
React Hook recipe from https://usehooks.com
View use-auth.jsx
import React, { useState, useEffect, useContext, createContext } from "react";
import * as firebase from "firebase/app";
import "firebase/auth";
import firebaseConfig from "../config/firebase";
// Add your Firebase credentials
firebase.initializeApp(firebaseConfig);
const AuthContext = createContext();
@deanc
deanc / BETTER_LOOKING_ATOM_STYLES.md
Created Apr 15, 2019
Better looking scrollbars on Atom Dark theme
View BETTER_LOOKING_ATOM_STYLES.md

Add this to your ~/.atom/styles.less file:

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
@deanc
deanc / gulpfile.js
Created Mar 14, 2019
Sample gulp v4 gulpfile.js
View gulpfile.js
const { src, dest, watch, parallel } = require('gulp');
const gulp = require('gulp');
const autoprefixer = require("autoprefixer");
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const cssnano = require("cssnano");
const less = require('gulp-less');
const livereload = require('gulp-livereload');
const path = require('path');
@deanc
deanc / .block
Created Feb 20, 2019 — forked from Fil/.block
Stressed Cells 1
View .block
license: gpl-3.0
@deanc
deanc / gist:b16b264dd8c74aeab4be0631b5ddba03
Created Feb 2, 2017
Reset meta-data on an object in S3 bucket using AWS Node SDK
View gist:b16b264dd8c74aeab4be0631b5ddba03
var params = {
Bucket: 'bucketname', /* required */
CopySource: '/bucketname/' + key, /* required */
Key: key, /* required */
ACL: 'public-read', /* optional */
ContentType: 'audio/mpeg', /* optional */
MetadataDirective: 'REPLACE',
};
s3.copyObject(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
@deanc
deanc / gist:d59081665da519847884
Created Aug 20, 2014
A simple class to create a paypal secure button
View gist:d59081665da519847884
<?php
namespace SkinBootstrap\Utility;
class Paypal {
public static function createButton($id, $name, $price, $debug = false) {
$username = PAYPAL_API_USERNAME;
$password = PAYPAL_API_PASSWORD;
View gist:9763197
$.getScript('//connect.facebook.net/en_UK/all.js', function(){
FB.init({
appId: 'APPID',
channelUrl: '//siteurl.com/channel.html',
});
$("#some-btn-id").click(function () {
FB.ui(
{
@deanc
deanc / gist:9739481
Created Mar 24, 2014
Pull in 5 latest tweets from twitter
View gist:9739481
$twitter_client = new \Guzzle\Http\Client('https://api.twitter.com/{version}', array(
'version' => '1.1'
));
$twitter_client->addSubscriber(new \Guzzle\Plugin\Oauth\OauthPlugin(array(
'consumer_key' => TWITTER_CONSUMER_KEY,
'consumer_secret' => TWITTER_CONSUMER_SECRET,
'token' => TWITTER_ACCESS_TOKEN,
'token_secret' => TWITTER_ACCESS_TOKEN_SECRET
)));
View gist:5011636
# memcached requires libevent
cd /usr/local/src
curl -O https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
tar -xvzf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable*
./configure
make
sudo make install
# Compile memcached utility