Skip to content

Instantly share code, notes, and snippets.

View maxpushka's full-sized avatar
💡
Mode: Idea overflow

Max Pushkarov maxpushka

💡
Mode: Idea overflow
View GitHub Profile
@oofnikj
oofnikj / answerfile
Last active June 29, 2024 01:41
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@pishangujeniya
pishangujeniya / Ubuntu-Mojave-Mac-OS-Theme.md
Last active February 3, 2023 02:24
Mac OS Mojave Theme for Ubuntu

Ubuntu To Mac OS Mojave theme

Mc OS Mojave Ubuntu Look alike


Pre-requisites

  • sudo apt update
  • sudo apt install gnome-tweaks
  • sudo apt-get install gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-gtkclutter-1.0
@cb372
cb372 / riscv.md
Last active June 8, 2024 10:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@laat
laat / tizen.sh
Last active March 9, 2024 11:06
Notes on Tizen commands that might work
sdb connect <ip>:<port> # connect to TV
sdb -s <deviceName> capability # get <installationPath>
# build
tizen cli-config "default.profiles.path=<profile_path>"
tizen build-web -out .buildResult -- <source-dir>
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file>
mv <package-file> .
rm -rf <source-dir>/.buildResult
@jbouzekri
jbouzekri / Vagrantfile
Created August 24, 2018 19:40
Vagrant file for ubuntu bionic 64 in gui mode
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |v|
v.gui = true
v.memory = 2048
end
# In case you need an IP to access the VM from another software :
# config.vm.network "private_network", ip: "192.168.56.101"
@Pitasi
Pitasi / check_telegram_signature.js
Last active May 19, 2024 08:51
Telegram website login widget, signature check sample using Node.js
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa,
// thanks for improving code style
const { createHash, createHmac } = require('crypto');
const TOKEN = "ABC:12345...";
// I prefer get the secret's hash once but check the gist linked
// on line 1 if you prefer passing the bot token as a param
const secret = createHash('sha256')
.update(TOKEN)
@Mygod
Mygod / export-ble-infos.py
Last active June 23, 2024 18:31
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@romainl
romainl / vanilla-linter.md
Last active May 6, 2024 01:48
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

// http:// stackoverflow.com/questions/23202489/how-does-this-code-find-the-number-of-trailing-zeros-from-any-base-number-factor
// https://comeoncodeon.wordpress.com/2010/02/17/number-of-zeores-and-digits-in-n-factorial-in-base-b/
function zeroes (base, number) {
var noz = Number.MAX_VALUE;
// Now we can break the Base B as a product of primes :
// B = a^p1 * b^p2 * c^p3 * …
//Then the number of trailing zeroes in N factorial in Base B is given by the formulae
// min{1/p1(n/a + n/(a*a) + ….), 1/p2(n/b + n/(b*b) + ..), ….}.
var j = base;
@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active June 28, 2024 15:16
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com