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
function saveNewAttachmentsToDrive() { | |
var folderId = "PUT_YOUR_FOLDER_ID_HERE"; // Replace with the ID of the destination folder in Google Drive | |
var searchQuery = "to:your-email@example.com has:attachment"; // Replace with the search query to find emails with attachments | |
var lastExecutionTime = getLastExecutionDate(); | |
var threads = GmailApp.search(searchQuery + " after:" + lastExecutionTime); | |
var driveFolder = DriveApp.getFolderById(folderId); | |
for (var i = 0; i < threads.length; i++) { | |
var messages = threads[i].getMessages(); | |
for (var j = 0; j < messages.length; j++) { | |
var message = messages[j]; |
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
#!/bin/sh | |
set -eu pipefail | |
echo "Attempting to connect to cicd-postman-tests-api" | |
until $(nc -zv cicd-postman-tests-api 5050); do | |
printf '.' | |
sleep 5 | |
done | |
echo "Connected to cicd-postman-tests-api!" |
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
version: '3' | |
services: | |
cicd-postman-tests-api: | |
container_name: cicd-postman-tests-api | |
image: vad1mo/hello-world-rest | |
cicd-postman-tests-newman: | |
container_name: cicd-postman-tests-newman | |
image: postman/newman | |
entrypoint: sh | |
command: /src/newman-wrapper.sh |
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
fun search(text: String): List<Movie> { | |
val movies = mutableListOf<Movie>() | |
val cursor = getDatabase().rawQuery("SELECT title, overview, poster, matchinfo(movies, 'pcnalx') FROM movies WHERE movies MATCH '$text*'", null) | |
if (cursor.moveToFirst()) { | |
do { | |
// Read and prepare matchinfo blob | |
val matchinfo = cursor.getBlob(3).toIntArray() | |
// Calculate score based on matchinfo values | |
// Here I'm only using the first column (title) to calculate the score |
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
func search(text: String) -> [Movie] { | |
var movies: [Movie] = [] | |
var statement: OpaquePointer? | |
let query = "SELECT title, overview, poster, year, matchinfo(movies, 'pcnalx') FROM movies WHERE movies MATCH '\(text)*'" | |
if sqlite3_prepare_v2(db, query, -1, &statement, nil) != SQLITE_OK { | |
print("Error preparing select: \(String(cString: sqlite3_errmsg(db)!))") | |
} |
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
String greet = Underwood.forSingle(String.class) | |
.withGroup("ExampleGroup") | |
.withName("ExampleCommand") | |
.withTimeout(5000) | |
.withFallback(e -> "Hello anonymous!") | |
.execute(() -> "Hello " + name + "!"); |
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
String s = new CommandHelloWorld("Frank").execute(); |
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 CommandHelloWorld extends HystrixCommand<String> { | |
private final String name; | |
public CommandHelloWorld(String name) { | |
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("ExampleGroup")) | |
.andCommandKey(HystrixCommandKey.Factory.asKey("ExampleCommand"))) | |
.andCommandPropertiesDefaults(HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(5000)); | |
this.name = name; | |
} |
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 AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
// Make sure this is before calling super.onCreate | |
setTheme(R.style.AppTheme); | |
super.onCreate(savedInstanceState); | |
} | |
} |
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
<activity android:name=".activities.MainActivity" | |
android:theme="@style/SplashTheme"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> |
NewerOlder