Skip to content

Instantly share code, notes, and snippets.

Best practices for PCB Design

Schematics

  • Power symbols should point upwards
  • Ground symbols should point downards
  • Sections should be labeled
  • Nets should generally not cross
  • Nets should be labeled
  • Either global or regular labels are fine
@jwswj
jwswj / gist:6152672
Last active December 20, 2015 15:18
2 instances of Skype running on a Mac

Make a copy of Skype:

  1. Open Finder.
  2. In the sidebar, click Macintosh HD > Applications.
  3. Click Skype to select it.
  4. Press Cmd+C, then Cmd+V to copy and paste Skype.
  5. Skype copy appears.

Change the bundle identifier in the Info.plist file:

@adamhjk
adamhjk / Guardfile
Last active December 17, 2015 03:19
A Guardfile with inline support for test-kitchen, before we turn it into a gem.
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
require 'guard/guard'
require 'mixlib/shellout'
module ::Guard
class Kitchen < ::Guard::Guard
def start
::Guard::UI.info("Guard::Kitchen is starting")
@roidrage
roidrage / wrap.rb
Last active May 3, 2018 04:46
A simple wrapper that forks off a child and prints out a progress dot every X seconds
#!/usr/bin/env ruby
pid = Kernel.fork do
`#{ARGV.join(" ")}`
exit
end
trap(:CHLD) do
print "\n"
exit
@gaffneyc
gaffneyc / node_update_from_file.rb
Created September 28, 2012 16:54
Replace attributes, run_list, and chef_environment for an existing node without losing automatic attributes.
class NodeUpdateFromFile < ::Chef::Knife
deps do
require "chef/node"
require "chef/json_compat"
require "chef/knife/core/object_loader"
end
banner "knife node update from file FILE (options)"
def loader
@jordansissel
jordansissel / RESULTS.md
Created September 21, 2012 07:41
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.

@jordansissel
jordansissel / logstash-mysql-query-parse.md
Last active June 7, 2021 21:10
parsing mysql's query log format with logstash

parsing mysql query logs with logstash

The problem is that some lines in the file are missing timestamps when they aren't continuations of any previous line. It's dumb, really.

The mysql query log is seriously bullshit format, but nothing logstash can't unscrew.

The main goal here is to show how we can fix the 'missing timestamp' problem.

% ruby bin/logstash agent -e '

@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:

@techtonik
techtonik / chef-webui-reset.py
Created July 2, 2012 17:07
Chef - Reset WebUI admin password
"""Reset admin password in Chef Server WebUI by removing admin user from DB"""
# based on http://lists.opscode.com/sympa/arc/chef/2011-08/msg00151.html
import urllib2
import json
COUCHSERV = 'localhost:5984'
COUCHDB = 'http://' + COUCHSERV + '/chef/'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 31, 2024 22:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname