Skip to content

Instantly share code, notes, and snippets.

@ritog
ritog / alacritty.toml
Created October 6, 2023 10:58
Example configuration file for Alacritty and simple guide
# $HOME/.config/alacritty/alacritty.toml
# by Rito Ghosh 2023-10-06
# Alacritty now uses TOML formatting for its config files.
# This is a simple example.
# There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
# It is not obvious how it translates to TOML. But it is extremely straightforward.
# example: WINDOW, COLORS, etc. are tables, and should be represented as [window], [colors], respectively.
@andrezrv
andrezrv / get-admin-path.php
Created October 30, 2014 21:18
Obtain path to wp-admin directory in WordPress.
<?php
/**
* Obtain the path to the admin directory.
*
* @return string
*/
function my_plugin_get_admin_path() {
// Replace the site base URL with the absolute path to its installation directory.
$admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() );
@azk-mochi
azk-mochi / llvm-clang6.0.0-build.sh
Last active April 28, 2024 03:05
Script to build LLVM+Clang for jailbroken iOS (ARM64)
#LICENSE: retain the following license
#BSD 3-Clause "New" or "Revised" License
#and this: https://github.com/leetal/ios-cmake/blob/master/LICENSE.md
#Tested on LLVM 6.0.0 and Clang 6.0.0
#using XCode 9.1, iOS11.1 SDK
#make build directory
mkdir llvm-clang-ios
@mihow
mihow / load_dotenv.sh
Last active April 28, 2024 03:02
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@vladwa
vladwa / SSH.py
Created December 31, 2017 07:30
Python code to execute command as a sudo user over ssh connection on a remote server using "paramiko" module. On The code snippet establishes connection and executes the command and return the status and output of the executed command.
import logging
import paramiko
class SSH:
def __init__(self):
pass
def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password):
"""Establishes a ssh connection to execute command.
:param ssh_machine: IP of the machine to which SSH connection to be established.
@tatumroaquin
tatumroaquin / archlinux-qemu-kvm.md
Last active April 28, 2024 03:00
QEMU-KVM Installation for Arch Linux

Arch Linux QEMU-KVM

install all necessary packages

sudo pacman -S virt-manager virt-viewer qemu qemu-arch-extra \
edk2-ovmf vde2 ebtables dnsmasq bridge-utils openbsd-netcat libguestfs

enable libvirt daemon

@GhibliField
GhibliField / 计算机类学术论文 28个常见出版社一般写法.md
Last active April 28, 2024 02:54
计算机类学术论文 28个常见出版社一般写法(参考文献用)
序号 出版社一般写法 出版地 备注
1 AAAI Menlo Park, CA Association for the Advancement of Artificial Intelligence
2 Academic 同Elsevier Academic Press is part of Elsevier
3 Academy Press New York/ London/ Paris/ San Diedo,CA/ San Francisco,CA/ Sao Paulo/ Sydney/ Tokyo/Toronto AP,Academy Press
4 ACL Stroudsburg,PA Association for Computational Linguistics
5 ACM New York, NY ACM Press,Association for Computing and Machinery
6 AP Professional Boston,MA/ San Diedo,CA/New York/ London/ Sydney/ Tokyo/ Toronto  
7 Chapman & Hall London/ Glasgow/ Weinheim/ New York/ Madras CH
@sirkha
sirkha / shell.nix
Last active April 28, 2024 02:53
gem5 shell env
with import <nixpkgs>{};
stdenv.mkDerivation rec {
name = "gem5-git";
env = buildEnv { name = name; paths = buildInputs; };
zlib-dev = lib.getDev zlib;
zlib-lib = lib.getLib zlib;
buildInputs = [
mercurial
git
gcc
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 02:51
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
@rohitprofc
rohitprofc / react-github-pages-publish.md
Created April 5, 2024 18:16
Commands and Setting for publishing a react application into github-pages

Publish React Applications to Github Pages

1. Create a React Application:

  • npx create-react-app <app_name>

  • cd <app_name>

  • npm start

2. Install gh-pages using npm: