Skip to content

Instantly share code, notes, and snippets.

@dashohoxha
dashohoxha / install_wifi_access_point.sh
Last active October 12, 2022 22:43
How to setup a Wifi Access Point on Ubuntu 12.04 (or its derivatives).
#!/bin/bash
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives).
### make sure that this script is executed from root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
"
@dashohoxha
dashohoxha / org.css
Created July 12, 2013 01:51
This CSS file is used for displaying HTML files generated by org-mode of Emacs.
body {
margin: 1em;
border-right: 5px solid #bbb;
border-bottom: 5px solid #bbb;
padding: 0;
background: #ddd none repeat scroll 0 0;
border: 1px solid #000;
margin: 0;
padding: 2em;
color: #000;
def troublesort(V):
done = False
while not done:
done = True
for i in range(len(V)-2):
if V[i] > V[i+2]:
done = False
V[i], V[i+2] = V[i+2], V[i]
def check(V):

Keybase proof

I hereby claim:

  • I am dashohoxha on github.
  • I am dashohoxha (https://keybase.io/dashohoxha) on keybase.
  • I have a public key ASClLI_RjQu6KDeKRN9_rdFd2cAI6QJ8fd7L2eckpxwIGwo

To claim this, I am signing this object:

@dashohoxha
dashohoxha / gist:8fe4b429e853fe82f4a17d185008bb74
Created February 25, 2018 12:33
git: recreate repository based on current files
cp .git/config /tmp/gitBackup
rm -rf .git
git init
cp /tmp/gitBackup .git/config
git remote add origin <url from 1st command>
git add .
git status
git commit -m "rewrite history"
git push -f
def solve(n, k)
l = 0
p2 = 1 # 2**0
k1 = k
n1 = n
chunk = n
while (k1 - p2 > 0)
k1 -= p2
n1 -= p2
chunk -= 1

Easy Blogging With Emacs

Time after time I write technical blogs and articles that describe and

# Problem A. Consonants, of Round 1C 2013, of CodeJam
# https://code.google.com/codejam/contest/2437488/dashboard#s=p0
$vowels = ['a', 'e', 'i', 'o', 'u']
def vowel?(c)
$vowels.include?(c)
end
# Problem A. Consonants, of Round 1C 2013, of CodeJam
# https://code.google.com/codejam/contest/2437488/dashboard#s=p0
$vowels = ['a', 'e', 'i', 'o', 'u']
def vowel?(c)
$vowels.include?(c)
end
def consonant?(c)
@dashohoxha
dashohoxha / osmos.rb
Last active December 17, 2015 00:19
Solution for Problem A (Osmos), of Round1B, CodeJam 2013: https://code.google.com/codejam/contest/2434486/dashboard#s=p0
# Solution for Problem A (Osmos), of Round1B, CodeJam 2013:
# https://code.google.com/codejam/contest/2434486/dashboard#s=p0
def solve(a, mots)
# If the list of mots is empty, we are done.
return 0 if mots == []
# If a is 1, the only way to make it solvable