This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
cant_put_in_public_gist = "URL" | |
while (command := input("$ ")) != 'exit': | |
x = requests.post(cant_put_in_public_gist, json={ "command" : command }) | |
json = x.json() | |
try: | |
print(json['result']) | |
except KeyError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chromium --ignore-certificate-errors "https://epiphany.pub/@seisvelas/Github-Gists-as-a-(free)-Headless-CMS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c 'print("\n".join(["fakeuser" + str(i) + "@fake.test," + "Mister " + str(i) for i in range(1000)]))' > fakeusers.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from collections import OrderedDict | |
def experiment_result(coin, day): | |
return OrderedDict({ | |
'coin': coin, | |
'day': day | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_pairs(until): | |
pairs = [] | |
for i in range(1, int(until / 2)+1): | |
pairs.append([i, until - i]) | |
return pairs | |
def nonDivisibleSubset(k, s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
def golden(a, b): | |
a, b = max(a, b), min(a, b) | |
return a / b == (a + b) / a | |
print( | |
golden(1 + sqrt(5), 2) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const twoSums = (list, sum) => list.some( | |
(e, i) => list.slice(i+1).some( | |
n => sum === e + n | |
) | |
) | |
console.log( | |
twoSums([10, 15, 3, 7], 10), // true because 3 + 7 = 10 | |
twoSums([10, 15, 3, 7], 8), // false | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_parens(depth, current='('): | |
if len(current) == depth * 2: | |
yield current | |
else: | |
opening = current.count('(') | |
closing = current.count(')') | |
if opening < depth: | |
yield from build_parens(depth, current + '(') | |
if closing < opening: | |
yield from build_parens(depth, current + ')') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[07:40] <+GeKo> so what i do when doing dev work is the following: | |
[07:41] <+GeKo> i take the latest tor browser, say, an alpha version (or have it already on my computer) | |
[07:41] <+GeKo> and extract it | |
[07:42] <+GeKo> then i copy over the things from obj-x86_64-pc-linux-gnu/dist/firefox/* | |
[07:42] <+GeKo> to your extracted tor-browser_en-US/Browser/ dir | |
[07:43] <+GeKo> (assuming you use the en-US version) | |
[07:43] <+GeKo> that gives you the changes you made in the tor-browser repository and compiled for testing | |
[07:44] <+GeKo> then you can see whether they work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alex@alex-ksquare:~/tor-browser$ ./mach build stage-package | |
/home/alex/tor-browser/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py:266: UserWarning: psutil failed to run: not sure how to interpret line ' 8 0 sda 381637 231217 14029637 296876 660191 2383224 84937712 1010416 0 456088 906520 35705 0 73009000 42258\n' | |
warnings.warn('psutil failed to run: %s' % e) | |
0:00.25 /usr/bin/make -j8 -s stage-package | |
0:02.37 ../../dist/firefox/libplc4.so: No gain. Skipping | |
0:02.37 ../../dist/firefox/libplds4.so: Couldn't find .bss. Skipping | |
0:02.37 ../../dist/firefox/libmozgtk.so: Couldn't find .bss. Skipping | |
0:02.38 ../../dist/firefox/gtk2/libmozgtk.so: Couldn't find .bss. Skipping | |
0:02.38 ../../dist/firefox/libmozwayland.so: No gain. Skipping | |
0:02.39 ../../dist/firefox/liblgpllibs.so: Couldn't find .bss. Skipping |