Skip to content

Instantly share code, notes, and snippets.

Code Apprentice codeguru42

Block or report user

Report or block codeguru42

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View output
F
======================================================================
FAIL: test_foo (__main__.FooTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/l/.IntelliJIdea2017.3/config/scratches/scratch.py", line 11, in test_foo
self.assertEqual(expected, actual)
AssertionError: 'foobar' != <MagicMock name='mock.foo()' id='140619506578448'>
----------------------------------------------------------------------
View foo.py
def foo(bar):
baz = bar.func()
if baz.name.lower()[-3:] == 'txt':
return baz.boo()
@codeguru42
codeguru42 / arch-linux-install.md
Last active Sep 30, 2017 — forked from Archerious/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI SSD system with full system encryption using dm-crypt and luks
View arch-linux-install.md
@codeguru42
codeguru42 / arch-linux-install.md
Created Sep 30, 2017 — forked from kylemanna/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
View arch-linux-install.md
View decrypt.py
def main():
with open(sys.argv[1]) as file:
plaintexts = map(lambda line : cryptopals.break_xor(bytes.fromhex(line.strip())), file)
for plain in plaintexts:
print(plain)
best = min(plaintexts, key=cryptopals.distance_from_english)
print(best)
View mytest.py
import unittest
class MyTests(unittest.TestCase):
def __init__(self, x, y):
super(MyTests, self).__init__("testMyMethod")
self.x = x
self. y = y
def testMyMethod(self):
self.assertEqual(self.y, my_method(self.x))
@codeguru42
codeguru42 / quantum_run.text
Created Dec 3, 2016
Run of Quantum Computer Simulator
View quantum_run.text
myrdraal% python main-file.py
How many qubits would you like to use? (Currently, only supports 1): 2
Would you like your initial qubits to be in the |0> state or |1> state? 0 or 1: 0
['Hadamard', 'X', 'Z', 'Y', 'sqrtX', 'phase shift', 'measurement', 'custom']
['cNOT', 'swap']
['Toffoli']
what gate would you like to use for 1st qubit? Use the list of single qubits at the top, plus control or targettarget
Which gate is this target qubit for? See list of two qubit gates at the top.X
Done with your 1st qubit? y or n
View wtf.git
$ git status
On branch ganujan/377/main
Your branch is up-to-date with 'ganujan/377'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: android/build/intermediates/transforms/dex/lite/debug/folders/1000/1f/main/classes.dex
no changes added to commit (use "git add" and/or "git commit -a")
View CustomAdapter.java
public class CustomAdapter extends ArrayAdapter<Pipeline> {
private List<Pipeline> data;
public CustomAdapter(Context context, List<Pipeline> data) {
super(context, -1);
this.data = data;
}
}
@codeguru42
codeguru42 / gist:64889738932aff4d4aee
Created Jun 2, 2015
./gradlew :android:dependencies (with suggested "exclude module: 'support-annotations'")
View gist:64889738932aff4d4aee
signing.properties not found
WARNING: Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.0) and test app (22.0.0) differ.
WARNING: Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.0) and test app (22.0.0) differ.
:android:dependencies
------------------------------------------------------------
Project :android - Injects the build id used by the Crashlytics SDK.
------------------------------------------------------------
_liteDebugAndroidTestApk - ## Internal use, do not manually configure ##
You can’t perform that action at this time.