Skip to content

Instantly share code, notes, and snippets.

@pietrodn
pietrodn / mavping.py
Created June 2, 2020 19:53
Tool to measure the latency in MAVLink connections
import copy
import logging
import math
import time
from typing import List
import argparse
import dronekit
from pymavlink.dialects.v20.common import MAVLink_timesync_message
@greird
greird / slack-files-downloader.sh
Last active April 30, 2024 13:49
Download all files from a Slack workspace export folder.
#!/bin/bash
#
# This script will browse a Slack export folder and download all files in a new /export folder
#
# HOW TO:
# 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export)
# 2. Make sure you have jq installed (https://stedolan.github.io/jq/)
# 3. Place this file at the root of your Slack export folder, next to channels.json
# 4. Run `bash slack-files-downloader.sh` in your terminal
#
@dreness
dreness / list_launchd_notifications.sh
Created October 14, 2023 13:14
LaunchEvents -> com.apple.notifyd.matching
find /System/Library/LaunchDaemons /System/Library/LaunchAgents -name "*.plist" \
| while read p ; do plutil -convert json -o - ${p} \
| jq -r ' .. | objects | with_entries(select(.key == "Notification")) | select(. != {}).Notification'
done | sort -u > ~/Desktop/all-launchd-notifications.txt
--ÇALIŞMA SORGULARI
--Brazil’de bulunan müşterilerin Şirket Adı, TemsilciAdi, Adres, Şehir, Ülke bilgileri
SELECT CompanyName, ContactName, [Address],City, Country
FROM Customers
WHERE Country='Brazil'
ORDER BY CompanyName
--— Brezilya’da olmayan müşteriler
SELECT CompanyName, ContactName, [Address],City, Country
FROM Customers
declare module "vue-instantsearch" {
import Vue from "vue";
import { InstantSearch, InstantSearchOptions } from "instantsearch.js/es/types/instantsearch";
import { SearchClient } from "instantsearch.js/es/types/algoliasearch";
export interface SearchItem {
value: string;
count: number;
label: string;
isRefined: boolean;
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@yuvalkarmi
yuvalkarmi / blockNextNavigation.js
Last active April 30, 2024 13:42
How to block a user from navigating away in NextJS when clicking on Link component
/*
In standard web apps, when users navigate away to a different page or website or attempt to refresh a page,
we can use the window event listener `beforeunload` to help users avoid losing the work.
However, when a user clicks on a native NextJS <Link> component, the navigation is not intercepted
because behind the scenes, no page changes are actually happening.
To intercept user navigation in a NextJS app, we can subscribe to the
router routeChangeError event and throw an error.
Note: we must throw an Error string - not a `new Error()` - which is why in the code below, we have
// eslint-disable-next-line no-throw-literal
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 30, 2024 13:41
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory