Skip to content

Instantly share code, notes, and snippets.

@jpgcc
jpgcc / what_the_heck_is_a_product_manager.md
Last active May 10, 2018 17:45
"What the heck is a Product Manager?" #LandingFest #CallForSpeakers

What the heck is a Product Manager?

Track: Careers

Description

Product Manager: one of the least well-defined roles in the computer industry, although quite popular nowadays. No two companies have the same description for this job title, and it can even vary widely within one company. Are they the CEO of the product (bleargh!)? Are they project managers wearing sneakers and hipster glasses? What do they do all day? Is this a business, marketing or technology role? Is this someone with a degree in engineering, or an MBA? What can make a software engineer want to become a product manager?

@sashaafm
sashaafm / erlang_formats.erl
Created October 4, 2016 13:07
Example on how to get all Erlang formats from source code to disassembled bytecode
% Example on how to get all Erlang formats from source code to disassembled bytecode
% Erlang Source --> Erlang AST --> Erlang Expanded AST --> Core Erlang --> BEAM Bytecode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% First the original module
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(add).
-export([add/2]).
###########################################
# serialization of indexes to byte arrays
###########################################
def serialize_index(index):
""" convert an index to a numpy uint8 array """
writer = faiss.VectorIOWriter()
faiss.write_index(index, writer)
return faiss.vector_to_array(writer.data)
@andruby
andruby / deploy.rb
Created January 26, 2011 19:48
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@sudara
sudara / puma.monitrc
Last active November 3, 2023 12:03
Example config needed to use monit with puma, monitoring workers for mem.
# this monit config goes in /etc/monit/conf.d
check process puma_master
with pidfile /data/myapp/current/tmp/puma.pid
start program = "/etc/monit/scripts/puma start"
stop program = "/etc/monit/scripts/puma stop"
group myapp
check process puma_worker_0
with pidfile /data/myapp/current/tmp/puma_worker_0.pid
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@protrolium
protrolium / ffmpeg.md
Last active April 8, 2024 11:49
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: