yarn create react-app app --template typescript
cd app/
yarn add -D typescript-plugin-css-modules
- In the
compilerOptions
oftsconfig.json
addtypescript-plugin-css-modules
plugin"plugins": [{ "name": "typescript-plugin-css-modules" }]
touch src/global.d.ts
- Add the following to
global.d.ts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 io import StringIO | |
import csv | |
import gzip | |
with gzip.open(filename, mode="rt") as g: | |
csvobj = csv.reader(g) | |
for line in csvobj: | |
print(line) |
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
Tempfile.open(["#{Rails.root}/tmp/", ".csv"]) do |f| | |
# Write the batch to a csv file (cheaper than 5000 queries) | |
f = ActiveSupport::Gzip.compress(ModelDatum.where(model_id: 2).pluck(:id, :preprocessed_data).map(&:to_csv).join) | |
puts f.size() | |
puts ActiveSupport::Gzip.decompress(f) | |
end |
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. Load the dataset | |
from sklearn.datasets import load_iris | |
iris = load_iris() | |
# 2. Select only the Petal length and Petal width features | |
#(easier to graph) | |
X = iris.data[:, 2:]# petal length and width | |
y = iris.target | |
# 3. Train our Decision Tree classifier on the Iris Dataset | |
from sklearn.tree import DecisionTreeClassifier | |
tree_clf = DecisionTreeClassifier(max_depth=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
package com.example.runtime_permissions; | |
import androidx.appcompat.app.AppCompatActivity; | |
import androidx.core.app.ActivityCompat; | |
import android.Manifest; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.location.Location; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.example034"> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="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
# frozen_string_literal: true | |
require "minitest/mock" | |
class MyJobTest < ActiveJob::TestCase | |
# Helper function to wrap mocking the :mymethod method | |
# | |
# expectations - Array of Procs/Lambdas that will be checked against the message | |
# argument that is passed to the :mymethod method in the MyModule::myclass | |
# object, all must return 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
# frozen_string_literal: true | |
require "minitest/mock" | |
class MyJobTest < ActiveJob::TestCase | |
test "check job calls method" do | |
mock = Minitest::Mock.new | |
mock.expect :mymethod, nil do |id:, message:| | |
id.is_a?(Integer) && | |
message.is_a?(String) |
Sign commits on the current branch since the SHA (inclusive)
git rebase --exec 'git commit --amend --no-edit -n -S' -i SHA^
NewerOlder