Skip to content

Instantly share code, notes, and snippets.

@mael
mael / tricks.md
Last active May 12, 2024 18:58
Xcode 10.2 "Unable to boot the Simulator"

Solution "Unable to boot the Simulator"

sudo mkdir /private/tmp

sudo chmod 1777 /private/tmp

Other basic command

xcrun

xcrun simctl list devices //to list all simulators

xcrun simctl delete // to delete specific device

@liyang85105
liyang85105 / print_macro.cc
Created August 15, 2017 03:14
print macro(#define macro ...)'s value when using gcc/g++
/* Some test definition here */
#define DEFINED_BUT_NO_VALUE
#define DEFINED_INT 3
#define DEFINED_STR "ABC"
/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
@steve228uk
steve228uk / gist:873d653f1ecec0456ea3f475b6e54f68
Created December 30, 2021 19:25
Farming Simulator Beacon HID control
On (Lasts for 10 seconds):
hidapitester.exe --vidpid 340D/1710 --open --length 10 --send-output 0x0,0xFF,0x01,0x66,0xC8,0xFF,0xAD,0x52,0x81,0xD6
Off:
hidapitester.exe --vidpid 340D/1710 --open --length 10 --send-output 0x0,0xFF,0x00,0x00,0x64,0x00,0x32,0x9E,0xD7,0x0D
Address: VID and PID (Vendor ID and Product ID)
@marcoandre1
marcoandre1 / SSH-configuration-github-gitlab.md
Last active May 12, 2024 18:56
Managing SSH keys for Github and Gitlab

Managing SSH keys for Github and Gitlab

NOTICE: This guide will help you set ssh keys for GitHub and GitLab. However, this is not going to change your commit user.name or user.email. If you need to change those for specific repositories, just run the following commands while in your repository:

git config user.name "Your Name Here"
git config user.email your@email.com

For more info, see this answer. Also, keep in mind this only changes the .git folder inside your repository which never gets added/committed/pushed/uploaded.

I recently had to manage two ssh keys (one for Github and one for Gitlab). I did some research to find the best solution. I am justing putting the pieces together here.

@thiagomgo
thiagomgo / lambda-curl.py
Created November 1, 2016 19:13
A simple lambda function written in python to execute a curl command
def lambda_handler(event, context):
import subprocess
result = subprocess.call("curl -I http://foo.bar", shell=True)
return result
@ptupitsyn
ptupitsyn / Dockerfile
Created June 15, 2023 13:05
Working .NET multi-arch Docker build (ARM + Intel)
# See https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/
# 8.0-preview-alpine works too
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build
ARG TARGETARCH
WORKDIR /source
# copy csproj and restore as distinct layers
COPY *.csproj .
RUN dotnet restore -a $TARGETARCH
@AveYo
AveYo / 7-Zip_Windows11.reg
Last active May 12, 2024 18:46
7-Zip Windows 11 Context Menu entries via whitelisted id reuse example by AveYo
Windows Registry Editor Version 5.00
; 7-Zip Windows 11 Context Menu entries via whitelisted id reuse example by AveYo
; Add to archive.. only single files (multiple would need a single instance redirect tool)
[-HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\connectNetworkDrive]
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\connectNetworkDrive]
"MuiVerb"="@C:\\Program Files\\7-Zip\\7-zip.dll,-2324"
"Position"="Middle"
"Icon"="C:\\Program Files\\7-Zip\\7-zip.dll,0"
@rxaviers
rxaviers / gist:7360908
Last active May 12, 2024 18:45
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@dsevilla
dsevilla / min-bib.el
Created September 8, 2020 11:20
Emacs Lisp code to take a .bbl file and extract from a original .bib file only the used citations, and put that into a destination .bib file.
(defun min-bib (mainbbl origbib destbib)
(interactive "fMain .bbl file: \nfOriginal .bib file: \nFDestination .bib file (will be overwritten): \n")
(let ((matches)
(dest-buffer (find-file-noselect destbib)))
(with-current-buffer (find-file-noselect mainbbl)
(goto-char 1)
(while (search-forward-regexp "\\\\bibitem{\\(.*?\\)}" nil t 1)
(push (match-string-no-properties 1) matches)))
(with-current-buffer dest-buffer (erase-buffer))
(with-current-buffer (find-file-noselect origbib)