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
import rclpy | |
from rclpy.node import Node | |
from rclpy.time import Time | |
from std_msgs.msg import String | |
from tf2_ros import TransformException | |
from tf2_ros.buffer import Buffer | |
from tf2_ros.transform_listener import TransformListener | |
class FrameListener(Node): |
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
import ( | |
"fmt" | |
"http" | |
"strconv" | |
) | |
func getUserId(r *http.Request) (int64, error) { | |
c, err := r.Cookie("uid") | |
if err != nil { | |
return 0, err |
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
import play.api.mvc.RequestHeader | |
def getUserId()(implicit request: RequestHeader) = { | |
request.cookies.get("uid").map(_.value.toLong).filter(_ > 0) | |
} |
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
import subprocess | |
import sys | |
import time | |
import os | |
def start(args, logfile, errfile): | |
if os.name == 'nt': | |
subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="blaze", stderr=errfile, stdout=logfile) | |
else: | |
subprocess.check_call("../sbt/sbt assembly", shell=True, cwd="blaze", stderr=errfile, stdout=logfile) |
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
class Foo { | |
def fetchLatestActivityStats(orgCode: String): Future[String] = { | |
val yesterday = DateTime.now - 1.day | |
recursivelyLatestFetchActivityStats(yesterday, orgCode, 0) | |
} | |
def recursivelyLatestFetchActivityStats( | |
date: DateTime, org: String, errCount: Int): Future[String] = { |
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
JavaScript(/* | |
* This is a build writing function for RequireJS configuration files. The purpose of it is to substitute any string literals that | |
* have a value starting with libPath. The libPath is used to determine the name of a module that can be found in paths. | |
* For example if libPath is "lib/" and paths is {"underscorejs/underscore":"http://somecdn/underscorejs"} then any string literals | |
* containing "lib/underscorejs/underscore" will be substituted with "http://somecdn/underscorejs/underscore". | |
* | |
* The function is intended to perform well given the initial scanning phase. Once the substitution array is collected | |
* then it is looped over and string concatenations are performed. The common scenario of a file not having anything | |
* to substitute results in only one concatenation. There are only (n * 2) + 1 concatenations to perform where n | |
* is the number of substitutions. |
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
#!/usr/bin/python | |
import datetime | |
import json | |
import os | |
from maxcdn import MaxCDN | |
def main(): | |
module = AnsibleModule( | |
argument_spec = dict( |
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
/** | |
* Highlighted Link Component extends the react-router Link component | |
* by adding a class to the active link. | |
*/ | |
define(['react', 'react-router'], function(React, Router) { | |
return React.createClass({ | |
mixins: [Router.NavigatableMixin], | |
isActive: function() { |
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
// Put this where you want the widget to appear: | |
<ci:widget /> | |
// Put this at the bottom fo the page: | |
<!-- clickigniter --> | |
<script type="text/javascript"> | |
(function() { |
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
{ | |
"results": [ | |
{ | |
"title": "foo", | |
"url": "http://bar" | |
}, | |
{ | |
"title": "foo", | |
"url": "http://bar" | |
}, |
NewerOlder