Skip to content

Instantly share code, notes, and snippets.

@bmaupin
bmaupin / free-backend-hosting.md
Last active May 2, 2024 05:31
Free backend hosting
@stevenyap
stevenyap / Capybara.md
Created October 23, 2013 05:03
Capybara Cheatsheet

Refer to: https://github.com/jnicklas/capybara

Note: Capybara does not show exceptions created by app. It will instead only tell you that the element you are searching for is not found.

Setup

  • Gemfile setup
gem "capybara"
gem 'selenium-webdriver' # requires for live browser demostration
@kdzwinel
kdzwinel / main.js
Last active May 2, 2024 05:30
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@bmaupin
bmaupin / free-database-hosting.md
Last active May 2, 2024 05:29
Free database hosting
@rain1024
rain1024 / azure_openai_nodejs_starter_code.js
Last active May 2, 2024 05:28
Azure OpenAI Starter Code
const axios = require('axios');
const YOUR_RESOURCE_NAME = ''; // Replace with your Azure OpenAI Resource name
const YOUR_DEPLOYMENT_NAME = ''; // Replace with your deployment id
const YOUR_API_KEY = ''; // Replace with your API key
const endpoint = `https://${YOUR_RESOURCE_NAME}.openai.azure.com/openai/deployments/${YOUR_DEPLOYMENT_NAME}/chat/completions?api-version=2023-05-15`;
async function getChatCompletions() {
try {
@Pulimet
Pulimet / AdbCommands
Last active May 2, 2024 05:27
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@rain1024
rain1024 / tut.md
Last active May 2, 2024 05:27
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
@caseywatts
caseywatts / randomgroupsofx.rb
Last active May 2, 2024 05:27
Random Groups of X
LISTOFNAMES = %{...}
GROUPSIZE = 5
names = LISTOFNAMES.split("\n")
shufflednames = names.shuffle
shufflednames.each_slice(GROUPSIZE).with_index do |group, i|
puts "\nGroup " + i.to_s
group.each {|name| puts name}
end
@trevorturk
trevorturk / gist:1756760
Created February 7, 2012 02:37
Bare minimum html5 template
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
<p>body</p>
</body>
</html>
@stephencelis
stephencelis / emoji.txt
Created April 3, 2012 18:38
iOS 6 / Mountain Lion Emoji
2139 ℹ INFORMATION SOURCE
23EB ⏫ BLACK UP-POINTING DOUBLE TRIANGLE
23EC ⏬ BLACK DOWN-POINTING DOUBLE TRIANGLE
23F0 ⏰ ALARM CLOCK
23F3 ⏳ HOURGLASS WITH FLOWING SAND
26C5 ⛅ SUN BEHIND CLOUD
26D4 ⛔ NO ENTRY
2705 ✅ WHITE HEAVY CHECK MARK
2753 ❓ BLACK QUESTION MARK ORNAMENT
2757 ❗ HEAVY EXCLAMATION MARK SYMBOL