Skip to content

Instantly share code, notes, and snippets.

View deanc's full-sized avatar
☁️

Dean Clatworthy deanc

☁️
View GitHub Profile
# 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
@deanc
deanc / gist:9739481
Created March 24, 2014 12:52
Pull in 5 latest tweets from twitter
$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
)));
$.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:d59081665da519847884
Created August 20, 2014 11:04
A simple class to create a paypal secure button
<?php
namespace SkinBootstrap\Utility;
class Paypal {
public static function createButton($id, $name, $price, $debug = false) {
$username = PAYPAL_API_USERNAME;
$password = PAYPAL_API_PASSWORD;
@deanc
deanc / gist:b16b264dd8c74aeab4be0631b5ddba03
Created February 2, 2017 14:55
Reset meta-data on an object in S3 bucket using AWS Node SDK
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 / .block
Created February 20, 2019 13:31 — forked from Fil/.block
Stressed Cells 1
license: gpl-3.0
@deanc
deanc / gulpfile.js
Created March 14, 2019 13:41
Sample gulp v4 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 / BETTER_LOOKING_ATOM_STYLES.md
Created April 15, 2019 11:13
Better looking scrollbars on Atom Dark theme

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

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

::-webkit-scrollbar-track {
@deanc
deanc / use-auth.jsx
Last active December 30, 2019 21:05 — forked from gragland/use-auth.jsx
React Hook recipe from https://usehooks.com
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 / veracrypt.md
Created August 21, 2020 12:20
Veracrypt (Truecrypt) CLI set permissions for NTFS mount

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.