Skip to content

Instantly share code, notes, and snippets.

View jshaw's full-sized avatar
🤖
👨‍🎨 👨‍💻

Jordan Shaw jshaw

🤖
👨‍🎨 👨‍💻
View GitHub Profile
@jshaw
jshaw / byobuCommands
Last active May 12, 2024 20:03
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@jshaw
jshaw / django-url-in-transblock
Created April 3, 2013 17:33
Django, having a url tag inside of a trans tag or transblock tag....
{%url 'nominations-form' as nomination_form %}
{% blocktrans %}
<p>Be the first to <a href="{{ nomination_form }}">nominate your community.</a></p>
{% endblocktrans %}
@jshaw
jshaw / vim-reference
Created April 3, 2013 22:51
Reference for VIM key commands
http://stackoverflow.com/questions/4556184/vim-move-window-left-right
http://www.worldtimzone.com/res/vi.html

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jshaw
jshaw / .bashrc
Last active October 22, 2017 23:51
Aliases used in my .bashrc file / tmux.conf tmux.conf references from http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course
# GIT
alias gs='git status'
alias gpl='git pull'
alias gc='git commit'
alias gp='git push'
alias ga='git add'
# GRUNT
alias gw='grunt watch --force'
alias gb='grunt build --force'
@jshaw
jshaw / commands
Created May 28, 2013 15:01
terminal command references
Grep
==========
grep -ir "some_string" some_directory
grep -ir --include=*.less "some_string" some_directory
@jshaw
jshaw / FBShareExample
Last active June 3, 2022 14:18
Basic FB Share link example that allows custom image url and description for dynamic content. This content would be available in the JS somewhere... like the context.
Core.prototype._initializeFbShare = function() {
$('#Fb-share').on('click', _(this._handleFbShare).bind(this));
};
Core.prototype._handleFbShare = function(event) {
event.preventDefault();
var image_url = this.getPaletteImageUrl(this.picker.config.shade_array);
var palette_name = this.$inputPalName.val();
var lang = document.documentElement.lang;
@jshaw
jshaw / markdown_cheatsheet
Created April 2, 2014 15:47
markdown cheatsheet
# Header 1 #
## Header 2 ##
### Header 3 ### (Hashes on right are optional)
#### Header 4 ####
##### Header 5 #####
## Markdown plus h2 with a custom ID ## {#id-goes-here}
[Link back to H2](#id-goes-here)
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
@jshaw
jshaw / eventClick.js
Last active August 29, 2015 14:05
example using underscore binding on events to keep class scope
// When using underscore this passes the class scope into the event handler (callback function)
// rather than having the click event scope in the handler (callback function)
Navigation.prototype._addClickEvent = function () {
var handler = _(this._handleEventClick).bind(this);
this.$nav_items.on('click', handler);
};
// Here this refers to Navigation.prototype rather than the event which gets passed in
Navigation.prototype._handleEventClick = function (evt) {
evt.preventDefault();
@jshaw
jshaw / js_template.html
Created August 26, 2014 21:26
example javascript templates using underscore.js templating
<!--Example JS template-->
<script type="text/template" id="PastCommunityTemplate">
<img class="pvs-cmy-img" src="<%= thumbnail %>" alt="<%= name %>">
<h3 class="pvs-cmy-title"><%= name %></h3>
<h4 class="pvs-cmy-city">City: <%= city %></h4>
<p class="pvs-cmy-description"><%= summary %></p>
</script>