Skip to content

Instantly share code, notes, and snippets.

@dinh
dinh / background .js
Last active May 2, 2024 02:33
[chrome.webRequest.onBeforeSendHeaders] usage #chrome #webRequest
//https://chrome.google.com/webstore/detail/header-editor/pkokmcnklmgbepioackopoknkdlhefjl
(function() {
var transformHeaders = function(headers) {
// [ { name: "", value: "" } ]
var list = [];
for (var i = 0; i < headers.length; i++) {
var header = headers[i];
@nimone
nimone / Sidebar.jsx
Created June 29, 2023 09:33
Retractable Sidebar Component purely in ReactJS and TailwindCSS
import { MoreVertical, ChevronLast, ChevronFirst } from "lucide-react"
import { useContext, createContext, useState } from "react"
const SidebarContext = createContext()
export default function Sidebar({ children }) {
const [expanded, setExpanded] = useState(true)
return (
<aside className="h-screen">
@AndreasMadsen
AndreasMadsen / index.html
Created September 17, 2015 20:05
chrome-bug
<!DOCTYPE html>
<meta charset="utf8">
<title>dprof visualizer</title>
<style>
/* general page layout */
html, body {
margin: 0;
height: 100%;
}
extends Camera2D
const SCREEN_SIZE := Vector2( 320, 180 )
var cur_screen := Vector2( 0, 0 )
func _ready():
set_as_toplevel( true )
global_position = get_parent().global_position
_update_screen( cur_screen )
@brpaz
brpaz / markdown-cheatsheet.md
Created February 1, 2019 22:22
A better markdown cheatsheet.
@brpaz
brpaz / CODE_OF_CONDUCT.md
Last active May 2, 2024 02:30
A Code of Conduct for Open Source Projects - https://www.contributor-covenant.org/

Contributor Covenant Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

// In the main process.
const { BrowserView, BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
win.on('closed', () => {
win = null
})
let view = new BrowserView({
webPreferences: {
void main () {
var settings = new Settings ("org.example.my-app");
// Getting keys
var greeting = settings.get_string ("greeting");
var bottles = settings.get_int ("bottles-of-beer");
var lighting = settings.get_boolean ("lighting");
print ("%s\n", greeting);
print ("%d bottles of beer on the wall\n", bottles);
@brpaz
brpaz / devilspie2_commands.txt
Created November 8, 2018 21:31
Devislpie2 commands
get_window_name()
returns a string containing the name of the current window.
get_application_name()
returns the application name of the current window.
set_window_position(xpos, ypos)
Sets the position of a window.
set_window_size(xsize, ysize)
@brpaz
brpaz / .elasticsearch_cheat_sheet.md
Last active May 2, 2024 02:30
ElasticSearch cheat cheat

ElasticSearch cheat sheet