Skip to content

Instantly share code, notes, and snippets.

View stevej's full-sized avatar

Steve Jenson stevej

View GitHub Profile
@mattvenn
mattvenn / openroad
Created April 26, 2023 17:00
Matt Liberty's OpenROAD GUI config
if [gui::enabled] {
create_toolbar_button -text "P/G" -script {
set pwr_vis [gui::check_display_controls "Nets/Power" visible]
set gnd_vis [gui::check_display_controls "Nets/Ground" visible]
gui::set_display_controls "Nets/Power" visible [expr !$pwr_vis]
gui::set_display_controls "Nets/Ground" visible [expr !$gnd_vis]
}
create_toolbar_button -text "Insts" -script {
gui::set_display_controls "Layers/*" visible false
@sorenmacbeth
sorenmacbeth / ham-mode.el
Created October 26, 2012 19:38
When you need to go HAM
(defconst ham-mode-keymap (make-sparse-keymap) "Keymap used in ham mode")
(define-key ham-mode-keymap (kbd "C-c C-0") 'go-ham)
(defgroup ham-mode nil
"HAM minor mode.")
(defun go-ham ()
(interactive)
(message "HARD AS A MOTHERFUCKER"))
#include <stdio.h>
#include <unistd.h>
int main(void) {
setbuf(stdout, NULL);
char *c = "\\-/|";
for (int i = 0; i < 4; i = (i == 3) ? 0 : i + 1) {
putc(c[i], stdout);
usleep(12000);
putc('\r', stdout);
@spullara
spullara / reverse.cpp
Created April 16, 2012 01:54
Modern c++11
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <future>
using namespace std;
string flip(string s) {
reverse( begin(s), end(s) );
@9len
9len / gist:2242038
Created March 29, 2012 18:55
A simple debug TProtocol
import com.twitter.conversions.string._
import java.nio.ByteBuffer
import org.apache.thrift.protocol._
import org.apache.thrift.transport.TTransport
import scala.collection.mutable
object ThriftDebugProtocol {
val Tab = " "
val KeyValueDelim = " = "
val NewLine = "\n"
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@rust
rust / emacs.rb
Created August 6, 2011 03:59 — forked from pingles/emacs.rb
Homebrew Emacs for OSX Lion with native full-screen
require 'formula'
class Emacs < Formula
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.3a.tar.bz2'
md5 'f2cf8dc6f28f8ae59bc695b4ddda339c'
homepage 'http://www.gnu.org/software/emacs/'
if ARGV.include? "--use-git-head"
head 'git://repo.or.cz/emacs.git'
else
package preloadagent;
/**
Copyright 2010 Sam Pullara
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
;; emacsd-tile.el -- tiling windows for emacs
(defun swap-with (dir)
(interactive)
(let ((other-window (windmove-find-other-window dir)))
(when other-window
(let* ((this-window (selected-window))
(this-buffer (window-buffer this-window))
(other-buffer (window-buffer other-window))
(this-start (window-start this-window))