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 subprocess | |
import requests | |
PYPI_URL = 'https://pypi.org/pypi/{package}/json' | |
def get_installed_packages(): | |
"""Get installed packages using pip freeze.""" | |
output = subprocess.check_output(['pip', 'freeze'], text=True) |
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
export class ApiError extends Error { | |
constructor(message) { | |
super(message); | |
this.name = 'ApiError'; | |
} | |
} | |
export default { | |
fetch: (url, fetchOptions) => { | |
return fetch(url, fetchOptions) |
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
URL: https://www.quora.com/webnode2/server_call_POST?_h=PXmhlXEVsUUz6S&_m=edit | |
METHOD: POST | |
HEADERS: | |
:authority: www.quora.com | |
:method: POST | |
:path: /webnode2/server_call_POST?_h=PXmhlXEVsUUz6S&_m=edit | |
:scheme: https | |
accept: application/json, text/javascript, */*; q=0.01 |
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
URL: https://www.quora.com/webnode2/server_call_POST?_h=zcNhf8gt8agBrS&_m=ask_question | |
METHOD: POST | |
HEADERS: | |
:authority: www.quora.com | |
:method: POST | |
:path: /webnode2/server_call_POST?_h=zcNhf8gt8agBrS&_m=ask_question | |
:scheme: https | |
accept: application/json, text/javascript, */*; q=0.01 |
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 json | |
import requests | |
from httmock import urlmatch, HTTMock | |
class HTTMockTest: | |
def test_hook_bin(self): |
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
.... | |
.... | |
public class MainActivity extends Activity { | |
.... | |
.... | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
.... |
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
var http = require( "http" ) | |
var Cookies = require( "cookies" ) | |
var keygrip = require("keygrip") | |
var assert = require("assert") | |
server = http.createServer( function( req, res ) { | |
var keys = keygrip(["SEKRIT2", "SEKRIT1"], 'sha256', 'hex') | |
var cookies = new Cookies( req, res, keys ) | |
, unsigned, signed, tampered |
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
"""Heater | |
A program that spawns as much number of processes as there are CPUs on the computer. | |
This keeps the core temprature high. | |
I made this so that my fingers feel more comfortable while working on my laptop during winter. | |
Caution : An eye should be kept on the CPU temprature so that when it is getting too hot, | |
the prgoram needs to be killed; else it can damage the CPU. | |
Author : Ishan | |
Email : [email protected] | |
""" |
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
1 | Which common chemical element has the atomic number 20? | Calcium | Potassium | Magnesium | Lithium | |
---|---|---|---|---|---|---|
2 | What type of paper detects acids and alkali in liquid? | Litmus Paper | Filter paper | Hydrion Paper | Proton Paper | |
3 | What is the only metal to be liquid at room temperature? | Mercury | Nickel | Chromium | Zirconium | |
4 | What is the chemical name of aqua fortis? | Nitric Acid | Hydrochloric Acid | Benzoic Acid | Acetic Acid | |
5 | What is the fourth state of matter after solid and liquid and gas? | Plasma | Ground State | Metal | Flora | |
6 | What is the chemical symbol for Plutonium? | Pu | Pa | Po | P | |
7 | What type of acid is used in wet cell car batteries? | Sulphuric | Amonic | Acetic | Malic | |
8 | What is the chemical symbol for chlorine? | Cl | Ca | C | Co | |
9 | What colour is liquid nitrogen? | Colourless | Black | Red | Brown | |
10 | Which gas is represented by the letter H on the periodic table? | Hydrogen | Hafmium | Holmium | Helium |
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 numberOfVowels(word): | |
counter = 0 | |
for letter in word: | |
if (letter == 'a' or letter == 'e' or letter == 'i' or letter == 'o' or letter == 'u'): | |
counter += 1 | |
return counter | |
print numberOfVowels('testing') |
NewerOlder