Skip to content

Instantly share code, notes, and snippets.

View tim-hub's full-sized avatar
:octocat:
Patience is Love

Tim tim-hub

:octocat:
Patience is Love
View GitHub Profile
@Richard-Mathie
Richard-Mathie / Redis Cluster Flask Cache.md
Last active June 12, 2017 14:10
Redis Cluster plugin for Flask Cache

Flask Cache Redis Cluster Backend

This impliments a redis cluster backend for Flask-Cache as the standard redis cache cannot handle a redis cluster.

Usage

class Config(object):
function get_browser() {
var ua = navigator.userAgent,
tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return {
name: 'IE',
version: (tem[1] || '')
};
}
@uraimo
uraimo / dnsovertls.md
Last active May 27, 2024 18:17
Configure your Mac to use DNS over TLS
@gaearon
gaearon / modern_js.md
Last active June 11, 2024 07:33
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
function get_browser() {
var ua = navigator.userAgent,
tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return {
name: 'IE',
version: (tem[1] || '')
};
}
@DerFichtl
DerFichtl / clamav-macosx.md
Last active January 2, 2024 22:34
clamav on mac osx - install and configure the virus scanner on mac osx
layout title published tags
post
clamav - install and configure on mac osx
true
blog
clamav

Install Clamav

Install clamav via homebrew

@LayZeeDK
LayZeeDK / generate-project.js
Last active April 28, 2022 08:04
Angular CLI workspace tool: Generate project.
const childProcess = require('child_process');
const fs = require('fs');
const yargs = require('yargs');
function addScopeToLibraryProjectName({ name, scope }) {
runCommand('npx json -I -f angular.json '
+ `-e "this.projects['${scope}-${name}'] = this.projects['${name}']"`);
runCommand(`npx json -I -f angular.json -e "delete this.projects['${name}']"`);
}
# initialise new project package environment
npm init
PIPENV_VENV_IN_PROJECT=1 pipenv install

# install major version of package P (and dependencies)
npm i P@1
pipenv install --selective-upgrade "P<2"