Skip to content

Instantly share code, notes, and snippets.

@blackbirdcoder
blackbirdcoder / Vagrantfile
Created February 24, 2024 14:04 — forked from martinkr/Vagrantfile
Vagrant: a simple setup with ngnix and php
# -*- mode: ruby -*-
# vi: set ft=ruby :
# "./Vagrantfile"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# set ports: according to your ngnix configuration
config.vm.network :forwarded_port, guest: 8080, host: 8080
@blackbirdcoder
blackbirdcoder / SQLite-PHP-quickstart.php
Created February 23, 2024 18:23 — forked from bladeSk/SQLite-PHP-quickstart.php
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
@blackbirdcoder
blackbirdcoder / devilspie-vscode-transparency.sh
Created February 3, 2024 19:56 — forked from marcel-dempers/devilspie-vscode-transparency.sh
How to make VSCode transparent in Linux
#!/bin/bash
sudo apt-get install -y devilspie
mkdir -p ~/.devilspie
echo '
(if (contains (window_class) "Code")
(begin
(spawn_async (str "xprop -id " (window_xid) " -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 "))
(spawn_async (str "xprop -id " (window_xid) " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xD8000000"))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--Based on the language defintion shared on:
https://wiki.gnome.org/Projects/GtkSourceView/LanguageDefinitions?action=AttachFile&do=view&target=asm-intel.lang
-->
<language id="assembler" name="Assembler (Intel)" version="2.0" section="Sources">
<metadata>
<property name="mimetypes">text/x-asm;text/x-assembler</property>
<property name="globs">*.asm</property>
</metadata>
@blackbirdcoder
blackbirdcoder / classes.py
Created May 8, 2023 09:35 — forked from rurtubia/classes.py
Classes in Python
#Objects and classes
# Classes let us define the blueprints for objects
from calendar import weekday
class Animal:
# When defining a class's attributes, if they are preceded by __, it means they are private
__name = ''
__height = 0