Skip to content

Instantly share code, notes, and snippets.

@simutisernestas
simutisernestas / Q2RPY.cpp
Last active January 30, 2024 10:26
ROS2 tf2 Quaternion to RPY
....
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
int main()
{
....
tf2::Quaternion quat_tf;
geometry_msgs::msg::Quaternion quat_msg = pose.pose.orientation;
tf2::fromMsg(quat_msg, quat_tf);
@dsmrt
dsmrt / query-aws-logs-insights.bash
Last active May 9, 2025 14:49
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
# this script queries aws logs with insights filtering on ERROR
# explanation of start and end times
#--start-time = unix timestamp 30 mins in the past
#--end-time = unix timestamp now
QUERY_ID=$(aws logs start-query \
--profile $profile \
--log-group-name /aws/lambda/aap-event-consumer-dev \
--start-time `date -v-30M "+%s"` \
@naoki-mizuno
naoki-mizuno / xkcd_colors.urdf.xacro
Last active March 21, 2025 14:36
Gazebo color palette with xckd color names
<?xml version="1.0"?>
<!-- https://www.w3schools.com/colors/colors_xkcd.asp -->
<robot>
<material name="acidgreen" >
<color rgba="0.5607843137254902 0.996078431372549 0.03529411764705882 1.0" />
</material>
<material name="adobe" >
<color rgba="0.7411764705882353 0.4235294117647059 0.2823529411764706 1.0" />
</material>
@DmytroLisitsyn
DmytroLisitsyn / country_dial_info.json
Last active April 9, 2025 10:57 — forked from Goles/CountryCodes.json
A JSON dataset of entities containing country name, code, dial (phone) code and flag emoji icon.
[{"name":"Afghanistan","flag":"๐Ÿ‡ฆ๐Ÿ‡ซ","code":"AF","dial_code":"+93"},{"name":"ร…land Islands","flag":"๐Ÿ‡ฆ๐Ÿ‡ฝ","code":"AX","dial_code":"+358"},{"name":"Albania","flag":"๐Ÿ‡ฆ๐Ÿ‡ฑ","code":"AL","dial_code":"+355"},{"name":"Algeria","flag":"๐Ÿ‡ฉ๐Ÿ‡ฟ","code":"DZ","dial_code":"+213"},{"name":"American Samoa","flag":"๐Ÿ‡ฆ๐Ÿ‡ธ","code":"AS","dial_code":"+1684"},{"name":"Andorra","flag":"๐Ÿ‡ฆ๐Ÿ‡ฉ","code":"AD","dial_code":"+376"},{"name":"Angola","flag":"๐Ÿ‡ฆ๐Ÿ‡ด","code":"AO","dial_code":"+244"},{"name":"Anguilla","flag":"๐Ÿ‡ฆ๐Ÿ‡ฎ","code":"AI","dial_code":"+1264"},{"name":"Antarctica","flag":"๐Ÿ‡ฆ๐Ÿ‡ถ","code":"AQ","dial_code":"+672"},{"name":"Antigua and Barbuda","flag":"๐Ÿ‡ฆ๐Ÿ‡ฌ","code":"AG","dial_code":"+1268"},{"name":"Argentina","flag":"๐Ÿ‡ฆ๐Ÿ‡ท","code":"AR","dial_code":"+54"},{"name":"Armenia","flag":"๐Ÿ‡ฆ๐Ÿ‡ฒ","code":"AM","dial_code":"+374"},{"name":"Aruba","flag":"๐Ÿ‡ฆ๐Ÿ‡ผ","code":"AW","dial_code":"+297"},{"name":"Australia","flag":"๐Ÿ‡ฆ๐Ÿ‡บ","code":"AU","dial_code":"+61"},{"name":"Austria","flag":"๐Ÿ‡ฆ๐Ÿ‡น","code":"AT","dial_code":"+43"},{"name":"Azerbaijan","flag":"๐Ÿ‡ฆ๐Ÿ‡ฟ","code":"AZ","dial_code":"+9
This file has been truncated, but you can view the full file.
9254835974458887629672873635789957411886024698554157393849494864228024962939550688297074527198420261051675205999609689838587412
7948702662533481896767559573369920938242346354580061545409242090168773727371802699309443935396635866263937828773324526334321892
7929250312741837331511829643632683169694074912332726993582394725302853411901337696207186358524323117172520907433878952968176465
9486937364148093931718552300016332142708943190856638524388888569011747617956915519539025796115901484762122047712200094207683584
0703675740855407318047361595661595146837376373951978537785605481083388906490085533348547865459237835407372374738389274773789264
3524314516560200536698529022539598732463389124803873184044464663165630452635665559603483233341839268186056673186867104904449866
3388466377320953222057779182433549144340237502432464295061371141084500222833875925546082542869030852833895137466510262849050187
2359980877010447170873386178573828860442255448874794721230413368694441497441338856684036949118353204002591974711928301953002372
@SteveHoggNZ
SteveHoggNZ / gist:cd3855a329632a3c3934adb80a5a646d
Created December 2, 2016 00:02
CloudFormation / Nested stack example
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Master template that includes nested templates",
"Parameters": {
"DeployBastion": {
"Description": "Should a bastion server be deployed?",
"Default": "No",
"Type": "String",
"AllowedValues": ["No", "Yes"]
}
@polaris
polaris / timePointAsString.cpp
Created June 20, 2016 11:53
Convert a std::chrono::system_clock::time_point to std::string
static std::string timePointAsString(const std::chrono::system_clock::time_point& tp) {
std::time_t t = std::chrono::system_clock::to_time_t(tp);
std::string ts = std::ctime(&t);
ts.resize(ts.size()-1);
return ts;
}
@geekmanager
geekmanager / make-git-use-sublime.markdown
Last active May 7, 2025 12:34
Making git use Sublime Text for rebase etc

Making git use Sublime Text

First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to subl which is the launcher from terminal:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

(added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink).

If there's any chance that bash doesn't check usr/local/bin then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen.

@joshlong
joshlong / gist:5441496
Created April 23, 2013 07:25
a complete, 1-step Spring Batch job with supporting infrastructure (JobLauncher, JobRepository, DataSource, PlatformTransactionManager) and business logic entirely in Java. This job will read in data in a property file and then write them to the database. I used constant Strings for the bean names that way I didn't have too many magic strings flโ€ฆ
// from my https://github.com/joshlong/a-walking-tour-of-all-of-springdom project
import org.apache.commons.logging.*;
import org.springframework.batch.core.*;
import org.springframework.batch.core.configuration.annotation.*;
import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.batch.item.*;
import org.springframework.batch.item.database.*;
import org.springframework.batch.item.file.FlatFileItemReader;
import org.springframework.batch.item.file.mapping.*;