Skip to content

Instantly share code, notes, and snippets.

View rafi's full-sized avatar

Rafael Bodill rafi

View GitHub Profile
@adtac
adtac / Dockerfile
Last active May 28, 2024 01:38
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
#!/bin/zsh
# WARNING! The script is meant to show how and what can be disabled. Don’t use it as it is, adapt it to your needs.
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12), macOS Ventura (13) and macOS Sonoma (14)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
@Blackshome
Blackshome / sensor-light.yaml
Last active July 22, 2024 12:43
Home Assistant Sensor Light that can be used in Blueprints
blueprint:
name: Sensor Light
description: >
# 💡 Sensor Light
**Version: 7.0**
Your lighting experience, your way - take control and customize it to perfection! 💡✨
@EldonMcGuinness
EldonMcGuinness / adobe-cc-2019-host.txt
Created April 6, 2021 11:41
Adobe CC 2019 activation host block
0.0.0.0 activate.adobe.com
0.0.0.0 practivate.adobe.com
0.0.0.0 ereg.adobe.com
0.0.0.0 wip3.adobe.com
0.0.0.0 activate.wip3.adobe.com
0.0.0.0 3dns-3.adobe.com
0.0.0.0 3dns-2.adobe.com
0.0.0.0 adobe-dns.adobe.com
0.0.0.0 adobe-dns-2.adobe.com
0.0.0.0 adobe-dns-3.adobe.com
@thomaspoignant
thomaspoignant / Makefile
Last active June 24, 2024 22:54
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@cristiklein
cristiklein / test-cloud-init.sh
Last active January 11, 2024 07:07
Short script to quickly test cloud-init configuration files
#!/bin/bash
set -e
IMAGE_URL=https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
IMAGE_FILE=$(basename $IMAGE_URL)
if [ ! -e $IMAGE_FILE ]; then
wget $IMAGE_URL
fi
@tekin
tekin / .gitattributes
Last active July 9, 2024 20:31
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 20, 2024 12:13
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@gilpanal
gilpanal / app.js
Last active April 3, 2024 15:16
The following code demonstrates how to get a file from Telegram without exposing Bot Secret Token in the client side. In this case is used to retrieve a MP3, but the example should work for other file types. An intermediate API, (server.js) built using Node.js, get the raw data of the file and forward it to the web client (index.html and app.js)
const TEL_PATH = '/music/file_352.mp3'
const API_FILEDONWLOAD = 'http://localhost:3000/fileDownload?'
const load = () => {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest()
xhr.open('GET', API_FILEDONWLOAD + TEL_PATH, true)
xhr.responseType = 'arraybuffer'