Skip to content

Instantly share code, notes, and snippets.

@ole
ole / swift-has-feature.sh
Last active May 9, 2024 13:32
List Swift compiler upcoming and experimental feature flags. (Note: the second script below, swift-list-features.sh, is probably the more useful one of the two. Unfortunately, I can't reorder them.)
#!/bin/zsh
# Test if the Swift compiler knows about a particular language feature.
#
# Usage:
#
# swift-has-feature [--swift SWIFT_PATH] FEATURE
#
# The exit code signals success (= the compiler knows this feature) or failure.
#
@ankurk91
ankurk91 / laravel_horizon.md
Last active May 9, 2024 13:32
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 20/22 server

Laravel 8+, Horizon 5.x, Redis 6+

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now; it should show status as inactive on horizon dashbaord

Install redis-server

import torch
import torch.nn.functional as F
from tqdm import tqdm
class Gaussian(object):
def __init__(self, mu, rho):
super().__init__()
self.mu = mu
self.rho = rho
@eshrh
eshrh / vns-on-linux.md
Last active May 9, 2024 13:31
Personal guide to visual novels on linux

Concise visual novel setup on linux

also see this guide which has better compatibility. This guide is forked from it. written by kamui-7

This guide is very close to exactly how I run vn's on my setup. I can't guarantee it'll work for everyone (in fact, i can probably guarantee it's broken for someone/some game)

Packages i use

sudo pacman -S wine-staging giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs lib32-gst-plugins-goo
@Pulimet
Pulimet / AdbCommands
Last active May 9, 2024 13:28
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
@kyokuheki
kyokuheki / esxi_trial_reset.sh
Last active May 9, 2024 13:28
ESXi trial reset
rm -r /etc/vmware/license.cfg
cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
/etc/init.d/vpxa restart
vim-cmd vimsvc/license --show | grep expirationDate
# see https://calvin.me/reset-esxi-evaluation-license/
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@kaushalvivek
kaushalvivek / replace_s3_content_type.py
Created May 27, 2021 18:06
Update ContentType for all objects in an S3 bucket based on file extension.
# imports
import boto3
import json
# constants
# note that the access key should be of a user who has write access to the bucket named here
BUCKET_NAME = '<>'
AWS_ACCESS_KEY_ID = '<>'
AWS_SECRET_ACCESS_KEY = '<>'
@crazygit
crazygit / parseTransaction.go
Last active May 9, 2024 13:22
Parse Ethereum Transaction, Decode input data, Decode output data
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
@akshaybabloo
akshaybabloo / get_dns_records.py
Last active May 9, 2024 13:22
Printing all DNS records using DNSPython in Python 3
#!/usr/bin/env python
# -*- coding utf-8 -*-
#
# Copyright 2016 Akshay Raj Gollahalli
import dns.resolver
def get_records(domain):
"""