This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" =~ "production" ]]; then | |
read -a array | |
pushed_ref=${array[1]} | |
remote_ref=${array[3]} | |
echo | |
echo "# Commits:" | |
git log --oneline $remote_ref...$pushed_ref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ModuleName | |
include OtherModules | |
delegate :some_method, to: :some_object | |
module ClassMethods | |
def class_method | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# my solution to ListsAndRecursion-6 of Programming Elixir 1.6 | |
# | |
defmodule MyList do | |
def flatten([]) do | |
[] | |
end | |
def flatten([head | tail]) when is_list(head) do | |
flatten(head) ++ flatten(tail) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
type_map = { | |
jpeg: 'Photos', | |
JPEG: 'Photos', | |
jpg: 'Photos', | |
JPG: 'Photos', | |
png: 'PNGs', | |
PNG: 'PNGs', | |
mov: 'Videos', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.fa-events-icons-failed { | |
&.icon { | |
&::before { | |
display: none; | |
} | |
&::after { | |
@extend .din-bold; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Angular: | |
dashboard.module.es6 // Defines the DashboardApp | |
dashboard.controller.es6 | |
order_queue.module.es6 // Defines the OrderQueueApp | |
order_queue.controller.es6 | |
modal.directive.js // A general purpose directive for displaying modals. Modal html is loaded from templates | |
Angular Templates: | |
dashboard_order_info_modal.html // Renders order_info_details | |
order_queue_info_modal.html // Also renders order_info_details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct order *orders; | |
// ... | |
// *orders is assigned to point to a block of memory returned by ALLOC_N (from ruby.h) | |
// ... | |
// Data in *orders is fine here | |
struct winning_order winners[winners_length]; | |
// Data in *orders is corrupt here (see below) | |
Subset of data pre and post local declaration of "winners" variable: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Evernote asks me to select a plan too often. I understand that Evernote wants to prompt me to upgrade in case my needs have changed; however, prompting every week or more is excessive. This week, it prompted me two days in a row. | |
I could accept frequent prompts when I go to the Evernote application, but the actual behavior is that it starts bouncing the Evernote icon in the doc when I am using other applications (I leave many apps, including Evernote, open most of the time), which interrupts work I am doing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After adding pubsub (using Pubnub.com) to our application, our headless specs were straight up breaking. Solved by creating a mock that we can trigger within the specs | |
Coffeescript required by application.js manifest: | |
class PubsubMock | |
subscribe: (obj) -> | |
@channels ||= {} | |
@channels[obj.channel] ||= [] | |
@channels[obj.channel].push(obj.message) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# <div "ng-repeat"="comment in comments"> | |
# <a class="remove" href="" "pj-confirm"="Really remove?" "popover-placement"="left" | |
# "on-confirm"="deleteComment" "callback-argument"="comment" "confirm-btn-label"="Yes" "cancel-btn-label"="No">Delete</a> | |
# </div> | |
# | |
# Dependencies: | |
# jQuery UI (for position function) | |
# Bootstrap CSS |
NewerOlder