Skip to content

Instantly share code, notes, and snippets.

View alexpusch's full-sized avatar

Alex Puschinsky alexpusch

View GitHub Profile
@alexpusch
alexpusch / perf-alpine-ecs.md
Last active November 30, 2022 16:51
Install perf on Linux Alpine, on Amazon ECS
@alexpusch
alexpusch / find_large_files.sh
Created December 23, 2018 09:09
Linux - find large files
find /home/ -type f -size +64M -exec ls -lh {} \;
@alexpusch
alexpusch / webrtc_example.js
Last active November 18, 2017 12:54
webRTC example
class ManualSignaling {
send(msg) {
console.log(serializeMsg(msg));
}
receive(msgString) {
const msg = deserializeMsg(msgString);
if (msg.type === 'offer') this.onReceiveOffer(msg);
if (msg.type === 'answer') this.onReceiveAnswer(msg);
@alexpusch
alexpusch / gist:dd26a740fe570760dd8e8b44342e8359
Created October 6, 2017 10:25
Increase Ubuntu max open files
ulimit -n 40000
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@alexpusch
alexpusch / index.html
Created October 2, 2017 20:21
Web workers performance test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="index.js"></script>
</head>
@alexpusch
alexpusch / PureComponent-pitfall-example.js
Created August 26, 2017 15:47
PureComponent pitfall example
import React, { Component } from 'react';
class App extends Component {
constructor(props) {
super(props);
this.state = {
counter: { num: 1 }
};
}
# remove exited containers
adocker rm -f $(adocker ps -f status=exited -q | tr '\r\n' ' ')
# remove dangling images
adocker rmi $(adocker images -q -f dangling=true | tr '\r\n' ' ')
# remove dangling volumes
adocker volume ls -qf dangling=true | xargs adocker volume rm
azk status --text | tr -s ' ' | cut -d ' ' -f 2 | sed -n '1!p' | while read -r line ; do
azk start $line
done
@alexpusch
alexpusch / CocoonJSAudioPlugin.js
Created June 3, 2014 19:12
CocoonJSAudioPlugin with volume property fixed
/*
* CocoonJSAudioPlugin
* Visit http://createjs.com/ for documentation, updates and examples.
*
*
* Copyright (c) 2012 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without