Skip to content

Instantly share code, notes, and snippets.

Avatar

Alun Davey 4lun

View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active Dec 1, 2020
Listen to your web pages
View plink-plonk.js
@cereallarceny
cereallarceny / index.js
Last active Jul 2, 2020
Server-side rendering in Create React App
View index.js
const md5File = require('md5-file');
const path = require('path');
// CSS styles will be imported on load and that complicates matters... ignore those bad boys!
const ignoreStyles = require('ignore-styles');
const register = ignoreStyles.default;
// We also want to ignore all image requests
// When running locally these will load from a standard import
// When running on the server, we want to load via their hashed version in the build folder
@deckarep
deckarep / regular_map.go
Created Sep 10, 2017
Regular Thread-Safe Int Map
View regular_map.go
package RegularIntMap
type RegularIntMap struct {
sync.RWMutex
internal map[int]int
}
func NewRegularIntMap() *RegularIntMap {
return &RegularIntMap{
internal: make(map[int]int),
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created Jun 2, 2017
ES6 exports / imports cheat sheet
View es6-import-cheat-sheet.md
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
@FoC-
FoC- / export.js
Created May 2, 2017
ES6 export import cheat sheet
View export.js
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
export default class foo {}
@jarretmoses
jarretmoses / React Native Clear Cache
Last active Dec 2, 2020
Clearing the Cache of your React Native Project
View React Native Clear Cache
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@4lun
4lun / setup-lolcommits.sh
Last active Jul 14, 2016
Setup script for lolcommits on OSX (requires brew) or Debian/Ubuntu (apt-get): https://github.com/mroth/lolcommits
View setup-lolcommits.sh
#!/usr/bin/env bash
if [ "$(uname)" == "Darwin" ]; then
echo -e "\n# Installing dependencies\n"
brew install imagemagick
brew install ffmpeg
echo -e "\n# Installing lolcommits\n"
sudo gem install lolcommits
@4lun
4lun / course-structure-msccs-birkbeck.md
Last active Jul 13, 2016
Course Structure - Computer Science (MSc) at Birkbeck University, London
View course-structure-msccs-birkbeck.md
@4lun
4lun / cmus-osx.md
Last active Feb 20, 2016
cmus on OSX (inc. mediakeys and lastfm integration)
View cmus-osx.md

cmus

Install

brew install cmus

cmusfm

Install

git clone git@github.com:Arkq/cmusfm.git
cd cmusfm
@cpswan
cpswan / nginx.conf
Last active Jul 26, 2020
Using nginx to proxy to an AWS ELB
View nginx.conf
daemon off;
worker_processes 1;
events { worker_connections 1024; }
http{
sendfile on;
You can’t perform that action at this time.