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
#!/usr/bin/python | |
__version__="0.0.1" | |
__author__="david" | |
__email__="[email protected]" | |
import argparse | |
import csv | |
import json | |
from multiprocessing import Process | |
import netaddr |
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
# Built application files | |
/*/build/ | |
# Crashlytics configuations | |
com_crashlytics_export_strings.xml | |
# Local configuration file (sdk path, etc) | |
local.properties | |
# Gradle generated files |
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
server { | |
listen 80; | |
server_name www.example.com; | |
rewrite ^ http://example.com$request_uri? permanent; #301 redirect | |
} | |
server { | |
listen 80; | |
server_name example.com; |
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
-480p - Run tenfoot in 480p rather than 1080p | |
-720p - Run tenfoot in 720p rather than 1080p | |
-accountrecovery - Perform account recovery | |
-all_languages - show longest loc string from any language | |
-bigpicture - Start in Steam Big Picture mode | |
-cafeapplaunch - Launch apps in a cyber cafe context | |
-candidates - Show libjingle candidates for local connection as they are processed | |
-ccsyntax - Spew details about the localized strings we load | |
-community - Set the community URL | |
-complete_install_via_http - Run installation completion over HTTP by default |
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
# retrieve webelement | |
input = driver.find_element_by_xpath("//*[@name='fieldname']") | |
# set attribute from js script referencing webelement found in python code | |
driver.execute_script("arguments[0].setAttribute('value', 'new value!')", input); | |
# or | |
driver.execute_script("arguments[0].setAttribute('value', arguments[1])", input, 'new value!'); | |
# Code for File Upload | |
file_input = driver.find_element_by_id("uploadBtn") | |
file_input.send_keys("/absolute/path/to/file") |
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 'dart:math'; | |
/* | |
We can use abstract classes to define an interface that can be implemented by subclasses | |
Very powerful: decouples code that uses an interface from its implementation | |
printArea() doesn't need to know that Sqaure and Circle even exist. | |
only needs a Shape argument with an area property | |
*/ |
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
class Person { | |
const Person(this.name, this.age); | |
final String name; | |
final int age; | |
factory Person.fromJson(Map<String, Object> json) { | |
final name = json['name']; | |
final age = json['age']; | |
if (name == null) { |
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 'dart:io'; | |
/* | |
* An implementation of shopping cart and checkout in Dart | |
* | |
*/ | |
class Product { | |
const Product({required this.id, required this.name, required this.price}); | |
final int id; | |
final String name; |
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
// .fromJson , .toJson example in Dart | |
// .fromJson convert a Map Object to an Instance | |
// .toJson convert an Instance to a Map Object | |
class Person { | |
Person({required this.name, required this.age}); | |
String name; | |
int age; | |
factory Person.fromJson(Map<String, Object> json) { | |
final name = json['name']; |
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
// simple copyWith method | |
class Credentials { | |
const Credentials({this.email = '', this.password = ''}); | |
final String email; | |
final String password; | |
Credentials copyWith({String? email, String? password}) { | |
return Credentials( | |
email: email ?? this.email, | |
password: password ?? this.password, |