Skip to content

Instantly share code, notes, and snippets.

@dardourimohamed
dardourimohamed / message-teams.js
Created November 3, 2020 15:22
Send Adaptive card to MS Teams channel using REST JavaScript
const axios = require("axios");
/*
1- In Microsoft Teams, choose More options (⋯) next to the channel name and then choose Connectors.
2- Scroll through the list of Connectors to Incoming Webhook, and choose Add.
3- Enter a name for the webhook, upload an image to associate with data from the webhook, and choose Create.
4- Replace the webhook URL into this variable.
*/
const webhookURL = "https://outlook.office.com/webhook/XXXXX...XXXXX/IncomingWebhook/XXXXX...XXXXX";
@arbakker
arbakker / README.md
Last active May 15, 2024 08:07
Minimal lighttpd proxy configuration to run in Docker

README

Minimal lighttpd configuration example which proxies all HTTP traffic on localhost:80 to localhost:3333. To run in a Docker container execute:

sudo docker run --rm -t -v "$(pwd)/lighttpd.conf:/etc/lighttpd/lighttpd.conf" -p 80:80 sebp/lighttpd
@DragoshDX
DragoshDX / app.css
Created April 30, 2024 07:24
pedro spinner
body {
background: #161616;
margin: 0;
height: 100dvh;
display: grid;
place-content: center center;
}
.spinner {
@TechRancher
TechRancher / Basic Ubuntu Commands.md
Last active May 15, 2024 08:05
Ubuntu 18.04 Terminal Commands

Basic Ubuntu Commands

This is a list of the most basic but extremely useful commands. Learning these will help you have a strong foundation to add more sophisticated commands upon.

Here are some words that we use and some meanings that you may associate them with.

We use What you may know them as
directory folder
sudo Run as Administor
@mp4096
mp4096 / ppt2pdf.ps1
Created April 28, 2016 10:56
Batch convert PowerPoint files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@kylerohr
kylerohr / ViewController.swift
Created April 18, 2015 16:07
Long Press Copyable UILabel
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Create our textLabel
let textLabel = MagicLabel(frame: CGRect(x: 50.0, y: 50.0, width: 200.0, height: 30.0))
self.view.addSubview(textLabel)
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 15, 2024 07:59
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example