Skip to content

Instantly share code, notes, and snippets.

@tbnorth
tbnorth / blacktape.py
Last active August 8, 2020 11:45
A PyQt "task launcher" for quick access to python scripts.
"""
A PyQt piece of black tape to cover annoying screen features.
terrynbrown@gmail.com, 2019-10-03
"""
import sys
try:
from PyQt5 import QtWidgets, QtCore, Qt
from PyQt5.QtCore import Qt as QtConst
@dmvaldman
dmvaldman / promisesEM.md
Last active June 1, 2024 00:20
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@lwoodson
lwoodson / Instructions.md
Last active November 10, 2015 07:35
Beaver -> Redis -> Logstash

Getting beaver talking to logstash w/multiline rollups over TCP & Redis.

Multi-line test

In terminal 1:

beaver -c beaver-tcp.conf

In terminal 2:

@juanje
juanje / Description.md
Last active November 30, 2023 19:29
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }
@cloudnull
cloudnull / neutron-vpnaas-fwaas-lbaas-configSetup.rst
Last active September 4, 2019 08:53
Setup Openstack Havana with Neutron using VPNaaS (VPN as a Service), FWaaS (Firewall as a Service), LBaaS (Load Balancer as a Service).

Installing Openstack VPNaaS, LBaaS, and FWaaS

This brief overview assumes that Openstack Havana has been installed and setup with Neutron Networking. If you have not already done this, you could use "https://github.com/cloudnull/rcbops_allinone_inone" or devstack to setup a dev box and then perform the following actions.


  • install "openswan":

    # (apt-get install openswan neutron-plugin-vpn-agent) || (yum install openswan openstack-neutron-vpn-agent && chkconfig neutron-vpn-agent on)
    
@dotJoel
dotJoel / google-webfonts.ttf.css
Last active February 19, 2024 18:43
CSS for all of Google's TTF web fonts
@font-face {
font-family: 'ABeeZee';
font-style: normal;
font-weight: 400;
src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://themes.googleusercontent.com/static/fonts/abeezee/v1/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype');
}
@font-face {
font-family: 'Abel';
font-style: normal;
font-weight: 400;
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@jordansissel
jordansissel / Procfile
Created April 5, 2012 19:29
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1