This file contains hidden or 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
| package org.example | |
| import akka.actor._ | |
| import akka.camel.{ CamelMessage, Consumer, CamelExtension } | |
| import org.apache.activemq.camel.component.ActiveMQComponent | |
| class CdrLogConsumer extends Actor with Consumer { | |
| def endpointUri = "activemq:FOO.BAR" | |
| def receive = { |
This file contains hidden or 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 'date' | |
| require 'nokogiri' | |
| require 'gnuplot' | |
| class Point | |
| attr_accessor :lon, :lat, :speed, :time | |
| def initialize(lon, lat, speed, time) | |
| @lon = lon | |
| @lat = lat |
This file contains hidden or 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
| .rotate (@deg) { | |
| -webkit-transform: rotate(@deg); | |
| -moz-transform: rotate(@deg); | |
| -ms-transform: rotate(@deg); | |
| -o-transform: rotate(@deg); | |
| } | |
| .loopRotated(@index) when (@index > 0) { | |
| .rotated-@{index} { |
This file contains hidden or 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
| Download "Format: Shapefile, Projection: WGS84 (Large polygons are split, use for larger scales)" from: | |
| http://openstreetmapdata.com/data/land-polygons | |
| Import into PG database with PostGIS extension: | |
| shp2pgsql -s 4326 land_polygons.shp | psql <database> | |
| Add index: | |
| CREATE INDEX idx_land_polygons_geom ON land_polygons USING gist(geom); | |
| Query example: |
This file contains hidden or 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
| <html> | |
| <body> | |
| <div id="my-app"></div> | |
| <script src="http://fb.me/react-0.11.1.js"></script> | |
| <script src="out/goog/base.js" type="text/javascript"></script> | |
| <script src="pomodoro.js" type="text/javascript"></script> | |
| <script type="text/javascript">goog.require("pomodoro");</script> | |
| </body> | |
| </html> |
This file contains hidden or 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 | |
| REMOTE=play@SERVER_IP | |
| REMOTE_APP=/home/play/PROJECT_NAME/ | |
| sbt stage || exit 1; | |
| rsync -va target/ $REMOTE:$REMOTE_APP/target; | |
| ssh $REMOTE "cd $REMOTE_APP; ./stop.sh"; | |
| ssh $REMOTE "cd $REMOTE_APP; ./start.sh"; |
This file contains hidden or 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 Foo where | |
| type Bar = { baz : Maybe Float } |
This file contains hidden or 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
| # yaourt displaylink | |
| # sudo systemctl enable displaylink.service | |
| # sudo systemctl start displaylink.service | |
| # xrandr --listproviders | |
| # xrandr --setprovideroutputsource 1 0 | |
| # sudo modprobe udl | |
| # sudo vim /etc/modules-load.d/udl.conf | |
| udl |
This file contains hidden or 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
| -- which style do you prefer? | |
| -- commas/brackets first | |
| rowView : Chart -> Html | |
| rowView chart = | |
| tr [] | |
| [ th [] | |
| [ text chart.label ] | |
| , td | |
| [ class "toggle" |
This file contains hidden or 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
| const sendMouseDrags = port => { | |
| let mouseDown = false; | |
| let mousePosition = { x: null, y: null }; | |
| const getPoint = e => ({ x: e.pageX, y: e.pageY }); | |
| document.addEventListener('mousedown', e => { | |
| mousePosition = getPoint(e); | |
| mouseDown = true; |