This file contains hidden or 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
""" | |
Given a plane Oxy and 2 points, find the line | |
Y = aX + b | |
a = (y2 - y1) / (x2 - x1) | |
b = y1 - a*x1 | |
Given a plane Oxy and 2 lines, find the intersection | |
Y = aX + b | |
X = (b2 - b1) / (a1 - a2) | |
X = (Y - b)/a |
This file contains hidden or 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 unittest | |
import mock | |
import subprocess | |
class PythonSubprocessTest(unittest.TestCase): | |
class MockPopen(object): | |
def __init__(self): | |
pass | |
def communicate(self, input=None): |
This file contains hidden or 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
for i in $@; do | |
git submodule deinit -f -- "$i" | |
rm -rf ".git/modules/$i" | |
git rm -f "$i" | |
done |
This file contains hidden or 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
<html> | |
<body> | |
<pre> | |
<?php | |
$myfile = fopen("index.php", "r") or die("Unable to open file!"); | |
echo fread($myfile,filesize("index.php")); | |
fclose($myfile); | |
?> | |
</pre> | |
</body> |
This file contains hidden or 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 struct | |
def key_code(code): | |
thisdict = { | |
1: "KEY_ESC", | |
3: "KEY_2", 4: "KEY_3", 5: "KEY_4", 6: "KEY_5", 7: "KEY_6", 9: "KEY_8", 11: "KEY_0", | |
12: "KEY_MINUS", 13: "KEY_EQUAL", | |
14: "KEY_BACKSPACE", 15: "KEY_TAB", | |
16: "KEY_Q", 18: "KEY_E", |
This file contains hidden or 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
# load templates on, transform it to gray color | |
react = ['like.png', 'liked.png', 'loved.png', 'haha.png', 'wow.png', 'sad.png', 'angry.png'] | |
reactions_haha = ['haha1.png', 'haha2.png', 'haha3.png', 'haha4.png'] | |
reactions_like = ['like1.png', 'like2.png'] | |
reactions_love = ['love1.png', 'love2.png', 'love3.png'] | |
reactions_sad = ['sad1.png', 'sad2.png', 'sad3.png', 'sad4.png', 'sad5.png'] | |
reactions_wow = ['wow1.png', 'wow2.png', 'wow3.png', 'wow4.png', 'wow5.png'] | |
gray_tempplates = [] | |
for i in react: |
This file contains hidden or 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 gmpy2 | |
n=374159235470172130988938196520880526947952521620932362050308663243595788308583992120881359365258949723819911758198013202644666489247987314025169670926273213367237020188587742716017314320191350666762541039238241984934473188656610615918474673963331992408750047451253205158436452814354564283003696666945950908549197175404580533132142111356931324330631843602412540295482841975783884766801266552337129105407869020730226041538750535628619717708838029286366761470986056335230171148734027536820544543251801093230809186222940806718221638845816521738601843083746103374974120575519418797642878012234163709518203946599836959811 | |
e=3 | |
cipher=2205316413931134031046440767620541984801091216351222789180582564557328762455422721368029531360076729972211412236072921577317264715424950823091382203435489460522094689149595951010342662368347987862878338851038892082799389023900415351164773 | |
with gmpy2.local_context(gmpy2.context(), precision=300) as ctx: | |
root = gmpy2.cbrt(cipher) | |
print (root) | |
abc = (int(root)) |
This file contains hidden or 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 sys | |
from datetime import datetime | |
f = open("ch13.txt", "r") | |
timeList = [] | |
char = '' | |
flag = "" |
This file contains hidden or 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 sys | |
import socket | |
import time | |
def egcd(a, b): | |
x,y, u,v = 0,1, 1,0 | |
while(a!=0): | |
q, r = b//a, b%a | |
m, n = x-u*q, y-v*q | |
b,a, x,y, u,v = a,r, u,v, m,n |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
<h1>js deobfuscator</h1> | |
<pre> | |
<script> | |
//########################### Given sourcecode ##################################################### | |
var ð= "\x71\x11\x24\x59\x8d\x6d\x71\x11\x35\x16\x8c\x6d\x71\x0d\x39\x47\x1f\x36\xf1\x2f\x39\x36\x8e\x3c\x4b\x39\x35\x12\x87\x7c\xa3\x10\x74\x58\x16\xc7\x71\x56\x68\x51\x2c\x8c\x73\x45\x32\x5b\x8c\x2a\xf1\x2f\x3f\x57\x6e\x04\x3d\x16\x75\x67\x16\x4f\x6d\x1c\x6e\x40\x01\x36\x93\x59\x33\x56\x04\x3e\x7b\x3a\x70\x50\x16\x04\x3d\x18\x73\x37\xac\x24\xe1\x56\x62\x5b\x8c\x2a\xf1\x45\x7f\x86\x07\x3e\x63\x47"; |