Skip to content

Instantly share code, notes, and snippets.

@moehlone
moehlone / make_writable.js
Created March 17, 2016 08:27
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**
@detain
detain / bash_shopt.md
Created May 4, 2024 00:09
BASH (shopt) Shell Options Explained

Bash Shel Options ( shopt ) Explained

I wasted time WTFM so RTFM

Enable OptionDisable OptionList Enabled OptionsEnabled Options Sample Output
shopt -s <opt>
shopt -u <opt>
echo $BASHOPTS
checkwinsize:cmdhist:complete_fullquote

This table illustrates the behavior of various shopt options in bash. By toggling these options, you can influence how the shell handles things like filename completion, history management, and error handling.

Option Description Disabled Enabled Example
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 4, 2024 00:04
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
@zachdaniel
zachdaniel / stream_distribute.ex
Last active May 4, 2024 00:02
A small demo to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`. Open in Livebook: https://livebook.dev/run?url=https%3A%2F%2Fgist.github.com%2Fzachdaniel%2Fd5ab06a9d2362fceeb6d27c37b206e28
<!-- livebook:{"persist_outputs":true} -->
# Distribute
## Section
A small toy to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`.
```elixir
defmodule Distribute do
@joaovictorino
joaovictorino / rode seu primeiro contêiner docker.md
Last active May 4, 2024 00:02
rode seu primeiro contêiner docker

Rode seu primeiro contêiner Docker

Abra o terminal e execute o seu primeiro contêiner "hello-world"

docker run hello-world

Analise a saída e percebe que duas ações foram feitas pelo Docker, baixar a imagem para sua máquina e executar o contêiner. Agora execute o comando abaixo

@Konfekt
Konfekt / chatgpt-write-msg.py
Last active May 4, 2024 00:02
let ChatGPT write a sensible commit message using an adaptable Python script
#!/usr/bin/env python3
# Adaption of https://github.com/tom-doerr/chatgpt_commit_message_hook/main/prepare-commit-msg
#
# Mark this file as executable and add it into the global hooks folder
# whose path is given by the core.hooksPath configuration variable
# skip during rebase
import sys
if len(sys.argv) > 2:
@jimmckeeth
jimmckeeth / manualadb.bat
Last active May 3, 2024 23:58
Manual ADB Deployment from RAD Studio Tools Menu
@echo off
REM Call from Delphi/RAD Studio IDE with the following parameters
REM $PATH($EXENAME) $NAMEONLY($PROJECT)
echo =============================================================
echo Be sure you Compile Android 64 and Deploy [Shift-Ctrl-Alt-F9]
echo.
echo Also set <application android:resizeableActivity="true"> in AndroidManifest.template.xml
echo =============================================================
echo Path: %1
set apk=%2\bin\%2.apk
@Gyvastis
Gyvastis / phpstorm_evaluation_license_reset.md
Last active May 3, 2024 23:57
PhpStorm reset evaluation license/period

PhpStorm reset evaluation license/period

Make sure to export/import your settings through File -> Manage IDE settings before/after

Windows 10

  1. Close PHPStorm
  2. Run these in PowerShell to remove PhpStorm configuration:
Remove-Item '.\AppData\Local\Jetbrains\PhpStorm*'
Remove-Item '.\AppData\Roaming\Jetbrains\PhpStorm*'
@mohammadlachgar
mohammadlachgar / M3U8
Last active May 3, 2024 23:51
Download and Save M3U8 videos
https://tajaribsoft-en.blogspot.com/2016/06/m3u8x.html
m3u8x is to help you download and save m3u8 videos.
You can select file formats, like .ts and MP4 .
All features