Skip to content

Instantly share code, notes, and snippets.

View marcohamersma's full-sized avatar

Marco Hamersma marcohamersma

View GitHub Profile
diff --git a/app/assets/javascripts/helpers/popper.js b/app/assets/javascripts/helpers/popper.js
index 9225d0cb6..6bace86df 100644
--- a/app/assets/javascripts/helpers/popper.js
+++ b/app/assets/javascripts/helpers/popper.js
@@ -1170,7 +1170,14 @@ const isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
* @returns {Object} The data object, properly modified
*/
function computeStyle(data, options) {
- const { x, y } = options;
+ var placement = data.placement.split('-')[0]
@marcohamersma
marcohamersma / switch.js
Created December 8, 2015 11:21
Thinking about alternate ways of defining a variable based on the value of another
// You need to get a new value based on the value of another variable,
// an if statement could get a bit messy so you might use a switch:
let someVariable;
switch (type) {
case 'bla':
someVariable 'someValue';
break;
}
// This syntax is a bit of a bother, first having to define the variable and
diff --git a/app/lib/views/sidebar-module.js b/app/lib/views/sidebar-module.js
index 64b92e9..8615822 100644
--- a/app/lib/views/sidebar-module.js
+++ b/app/lib/views/sidebar-module.js
@@ -132,6 +132,7 @@ SidebarModule = module.exports = View.extend({
no_items : this.getCount() === 0,
iconClassName : this.iconClassName,
more : !!(this.moreText && this.moreLink),
+ externalMore : this.moreLink && this.moreLink.indexOf('/') !== 0,
moreText : this.moreText,
@marcohamersma
marcohamersma / standup.sh
Created June 11, 2012 08:29
Gives a list of all the commits that you've done in the last day, or x days if you add a number of days as an argument
function standup {
if [ $1 ]; then dayno=$1; else dayno='1'; fi
git log --author=marco --since=$dayno.days --until 06:00 --all --reverse --format="%Cblue%h%Creset %s %Cgreen %cr"
}
@marcohamersma
marcohamersma / pivotalThings.rb
Created September 1, 2011 12:52
Script that allows you to take a pivotal URL and make it a Things task
## Argument usage:
## ruby pivotalthings [url] [p/t] [beta]
## url = path to pivotal ticket
## p = make a project
## t = make only a todo
## beta = add beta to the end of the command line to use Things beta if installed
require "appscript"
include Appscript
require "Curb"
@marcohamersma
marcohamersma / gist:909610
Created April 8, 2011 10:26
Very simple script for converting OPML files that are generated by OmniOutliner to HTML
<?
function parseOutliner($url) {
$content=file_get_contents($url);
$content=simplexml_load_string($content);
$title=$content->head->title;
$content=$content->body->outline;
foreach ($content as $item) {
$titleHTML=preg_replace('! <(http.*?)>!','<a class="ref" href="$1">@</a>',$item['text']);
$return.='<h2>'.$titleHTML.'</h2>';