Skip to content

Instantly share code, notes, and snippets.

@na-stewart
na-stewart / sv_loadout_conflict_handler.lua
Last active April 20, 2024 03:17
GMod Pointshop2 loadout fix. When a player spawns ontop of a pickup, it overrides the item in their inventory. This module fixes this by enforcing loadout assignment.
-- pointshop2-master\lua\ps2\modules\weapons
hook.Add( "PlayerSpawn", "InitLoadoutConflictListener", function( ply )
ply.ps2LoadoutPrimaryAssigned = false;
ply.ps2LoadoutSecondaryAssigned = false;
end )
hook.Add( "PlayerCanPickupWeapon", "LoadoutConflictListener", function( ply, weapon )
-- Prevent pickup until player inventory is loaded.
if not ply.PS2_Inventory then return false end
-- Cancel listener if player is a ghost (for specDM).
@peak-load
peak-load / README.md
Created August 5, 2018 11:42 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@iamchriswick
iamchriswick / interesting_startups_in_the_recruiting_and_hiring_space.md
Last active December 31, 2020 22:32
Even tech giants like Google admit they can’t find a solution to the hiring problem.

Interesting Startups in The Recruiting & Hiring Space

Finding people who want to work for your startup should be easy.

Companies like Google, Facebook, and Twitter have transformed the general perception of joining a startup in recent years. What was once seen as a risky move is now seen as a promising opportunity by recent graduates and veteran workers alike.

"Startups are no longer niche; they have gone mainstream."

–Daniel Gulati, co-author of Passion & Purpose

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@SpainTrain
SpainTrain / do-release.sh
Created October 9, 2015 20:08
bash script to check for release directive and bump, tag, and publish to npm
#!/bin/bash
set -ex
git config --global user.email "ci@provider.com"
git config --global user.name "CI"
git config --global push.default simple
LAST_COMMIT_MSG="$(git log -1 --pretty=%B)"
SEMVER_BUMP_TYPE="$(echo ${LAST_COMMIT_MSG} | sed -n 's/^.*[rR]elease v+\([a-z]\+\).*$/\1/p')"
@jaceklaskowski
jaceklaskowski / deployment-tool-ansible-puppet-chef-salt.md
Last active January 3, 2024 22:12
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@derekseymour
derekseymour / freshdesk_sso.js
Last active June 17, 2020 15:59
Freshdesk Single Sign On URL - Node.js
var crypto = require('crypto');
/**
* Generates and returns a Freshdesk Single Sign On URL
* {@link https://gist.github.com/derekseymour/26a6fe573c1274642976 Gist}
*
* @author Derek Seymour <derek@rocketideas.com>
* @param {String} name - The name of the user logging in.
* @param {String} email - A valid email address to associate with the user.