Skip to content

Instantly share code, notes, and snippets.

@robertolos
robertolos / twitter.rb
Last active October 5, 2015 09:59
Shopify dashing - Twitter mentions
require 'twitter'
#### Get your twitter keys & secrets:
#### https://dev.twitter.com/docs/auth/tokens-devtwittercom
twitter = Twitter::REST::Client.new do |config|
config.consumer_key = 'YOUR_CONSUMER_KEY'
config.consumer_secret = 'YOUR_CONSUMER_SECRET_KEY'
config.access_token = 'YOUR_ACCESS_TOKEN'
config.access_token_secret = 'YOUR_ACCESS_TOKEN_SECRET'
@robertolos
robertolos / comments.html
Created October 5, 2015 10:01
Shopify Dashing - Comments widget for twitter mentions
<h1 class="title" data-bind="title"></h1>
<div class="comment-container">
<h3><img data-bind-src='current_comment.avatar'/><span data-bind='current_comment.name' class="name"></span></h3>
<p class="comment" data-bind='quote'></p>
<img id="media" data-showif="current_comment.media" data-bind-src='current_comment.media'/>
</div>
<p class="more-info" data-bind="moreinfo"></p>
@robertolos
robertolos / comments.coffee
Created October 5, 2015 10:03
Shopify dashing - Comments widget for twitter mentions
class Dashing.Comments extends Dashing.Widget
@accessor 'quote', ->
"“#{@get('current_comment')?.body}”"
ready: ->
@currentIndex = 0
@commentElem = $(@node).find('.comment-container')
@nextComment()
@startCarousel()
@robertolos
robertolos / comments.scss
Created October 5, 2015 10:05
Shopify dashing - Comments widget for twitter mentions
// ----------------------------------------------------------------------------
// Sass declarations
// ----------------------------------------------------------------------------
$background-color: #eb9c3c;
$title-color: rgba(255, 255, 255, 0.7);
$moreinfo-color: rgba(255, 255, 255, 0.7);
// ----------------------------------------------------------------------------
// Widget-comment styles
@robertolos
robertolos / dashing.erb
Created October 5, 2015 10:07
Shopify dashing - Comments widget for twitter mentions
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-id="twitter_mentions" data-view="Comments" style="background-color:#00afd7;" data-moreinfo="Tweets @YoutTweetAccount" ></div>
<i class="icon-twitter icon-background"></i>
</li>
[roberto@WKST0134 generator-jhipster]$ cat /usr/lib/node_modules/generator-jhipster/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'aws-sdk' ]
2 info using npm@3.5.0
3 info using node@v5.1.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData aws-sdk
8 silly fetchNamedPackageData aws-sdk
@robertolos
robertolos / git-bulk-branches-remove
Last active January 17, 2018 10:41
Bulk remove of git branches from local and remote
#removes all the branch starting with HP-14
git branch -a | awk -F/ '/\/HP-14/{print $3}' | xargs -I {} git push origin :{}
@robertolos
robertolos / GoogleResource.java
Created May 19, 2018 09:12
Serve Google assetlinks.json using spring boot
package com.adaptyou.wama.server.web.rest;
import com.codahale.metrics.annotation.Timed;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@robertolos
robertolos / spinDownHd
Created September 6, 2018 08:20
Spin down usb hard drive
# activate the script via crontab as root user
# */5 * * * * /home/roberto/script/spinDownHd2 > /home/roberto/logspindown
DISK=sda
echo "start"
SGSTART=/usr/bin/sg_start
if [ ! -x $SGSTART ]
then
echo "$SGSTART missing. aborting."
exit 1
@robertolos
robertolos / gist:acbb1f9692a3e598a67117b6048f7034
Created April 14, 2022 07:05
Kill process running on port 3000
lsof -i 4tcp:3000 -sTCP:LISTEN | awk '{if(NR>1)print $2}' | xargs kill