Skip to content

Instantly share code, notes, and snippets.

@stalmok
stalmok / strip-whitespace.js
Created January 6, 2013 16:51
JavaScript: Strip Whitespace From String
// http://css-tricks.com/snippets/javascript/strip-whitespace-from-string/
// Remove leading and trailing whitespace
// Requires jQuery
var str = " a b c d e f g ";
var newStr = $.trim(str);
// "a b c d e f g"
// Remove leading and trailing whitespace
// JavaScript RegEx
@danijar
danijar / blog_tensorflow_scope_decorator.py
Last active January 17, 2023 01:58
TensorFlow Scope Decorator
# Working example for my blog post at:
# https://danijar.github.io/structuring-your-tensorflow-models
import functools
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def doublewrap(function):
"""
A decorator decorator, allowing to use the decorator to be used without
@tony612
tony612 / arcanist_cheatsheet.md
Last active July 7, 2023 05:29 — forked from sekimura/gist:6367366
arcanist cheatsheet
  • create tasks T{NNNN} asign them
  • create a branch with name like "T{NNNN}-boo-hoo"
  • git checkout -b T1234-boo-foo
  • commit changes on that branch until it gets ready to be reviewed
  • git commit -am 'first'
  • git commit -am 'now it works'
  • check if it's lint free (NOTE: it runs lint against only modified files)
  • arc lint
  • push a review request to the server. This will create a diff with id D{NNNN}
  • arc diff
@robskillington
robskillington / prometheus.proto
Last active February 15, 2024 22:23
Example Python Prometheus remote write client
// Copyright 2016 Prometheus Team
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@darencard
darencard / maker_genome_annotation.md
Last active March 7, 2024 08:50
In-depth description of running MAKER for genome annotation.

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Genome Annotation using MAKER

MAKER is a great tool for annotating a reference genome using empirical and ab initio gene predictions. GMOD, the umbrella organization that includes MAKER, has some nice tutorials online for running MAKER. However, these were quite simplified examples and it took a bit of effort to wrap my head completely around everything. Here I will describe a de novo genome annotation for Boa constrictor in detail, so that there is a record and that it is easy to use this as a guide to annotate any genome.

Software & Data

Software prerequisites:

  1. RepeatModeler and RepeatMasker with all dependencies (I used NCBI BLAST) and RepBase (ver
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@da-n
da-n / gist:9998623
Created April 5, 2014 22:01
Rename a tag in git

Rename a git tag old to new:

git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags

The colon in the push command removes the tag from the remote repository. If you don't do this, git will create the old tag on your machine when you pull.

-- source http://stackoverflow.com/a/5719854/695454

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 11, 2024 07:57
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@benjamincharity
benjamincharity / autonomous.txt
Last active April 12, 2024 22:20
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.