Skip to content

Instantly share code, notes, and snippets.

@tcocca
tcocca / missing_spec_generator.rb
Created August 19, 2010 12:44
A library to generate missing rspec spec files for a rails project (just drop in lib)
require 'erb'
class MissingSpecGenerator
def spec_file(spec_path, file_name, spec_template, namespace)
spec_name = file_name.gsub('.rb', '') + '_spec.rb'
if File.exist?("#{spec_path}/#{spec_name}")
puts "#{spec_path}/#{spec_name} exists"
else
puts "#{spec_path}/#{spec_name} missing"
@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:

@errordeveloper
errordeveloper / setup.md
Created November 11, 2012 20:41 — forked from 17twenty/gist:2712354
Setting-up Yocto for MACHINE=beaglebone

Checkout repositories

  1. Poky
git clone git://git.yoctoproject.org/poky && cd poky
  1. OE metadata layers
@willurd
willurd / web-servers.md
Last active July 3, 2024 13:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@muscardinus
muscardinus / sunspot.cap
Last active December 17, 2023 03:04
sunspot tasks for Capistrano 3
namespace :deploy do
before :updated, :setup_solr_data_dir do
on roles(:app) do
unless test "[ -d #{shared_path}/solr/data ]"
execute :mkdir, "-p #{shared_path}/solr/data"
end
end
end
end
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@cavinsmith
cavinsmith / nvidia.md
Last active May 23, 2024 05:40
Nvidia GPUs sorted by CUDA cores

List of desktop Nvidia GPUS ordered by CUDA core count

I created it for those who use Neural Style

Guys, please add your hardware setups, neural-style configs and results in comments!

GPU CUDA cores Memory Processor frequency
GeForce GTX TITAN Z 5760 12 GB 705 / 876
@Vitorbnc
Vitorbnc / stm32_gpio_registers_and_c_bitwise.md
Created August 17, 2016 01:00
How to set bits in C and write to STM32 GPIO registers using Arduino IDE

STM32duino GPIO Registers and Programming

Bit Setting in C

Setting a bit

Use the bitwise OR operator ( | ) to set a bit.

number |= 1 << x;
@bjoernalbers
bjoernalbers / osx_service.rb
Created September 30, 2016 21:11
osx_service - Ansible module to manage launchd services on Mac OS X
#!/usr/bin/ruby
# WANT_JSON
#
# osx_service - Ansible module to manage launchd services on Mac OS X
#
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Björn Albers <bjoernalbers@gmail.com>
#