These rules are adopted from the AngularJS commit conventions.
Discover gists
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
/// If an error occurs while getting the amount of memory used, the first returned value in the tuple will be 0. | |
func getMemoryUsedAndDeviceTotalInMegabytes() -> (Float, Float) { | |
// https://stackoverflow.com/questions/5887248/ios-app-maximum-memory-budget/19692719#19692719 | |
// https://stackoverflow.com/questions/27556807/swift-pointer-problems-with-mach-task-basic-info/27559770#27559770 | |
var used_megabytes: Float = 0 | |
let total_bytes = Float(ProcessInfo.processInfo.physicalMemory) |
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
print(""" | |
Código nosso que estás em C | |
Santificado seja vós, Console | |
Venha a nós o vosso array[10] | |
E seja feita, sim, {vossa chave} | |
Assim no if{} como no else{} | |
O for (nosso; de cada dia; nos dai hoje++) | |
Debugai as nossas sentenças | |
Assim como nós colocamos o ponto e vígula esquecido; | |
E não nos deixeis errar identação |
Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:
Up Arrow
: Will show your last commandDown Arrow
: Will show your next commandTab
: Will auto-complete your commandCtrl + L
: Will clear the screen
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
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
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
'use strict'; | |
var node = require('@remix-run/node'); | |
node.installGlobals(); |
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
# "Проверка" | ConvertTo-Encoding windows-1251 koi8-r | |
# Get-Content notes.txt | ConvertTo-Encoding "windows-1251" "koi8-r" | Set-Content decoded.txt | |
function ConvertTo-Encoding ([string]$From, [string]$To){ | |
Begin{ | |
$encFrom = [System.Text.Encoding]::GetEncoding($from) | |
$encTo = [System.Text.Encoding]::GetEncoding($to) | |
} | |
Process{ | |
$bytes = $encTo.GetBytes($_) | |
$bytes = [System.Text.Encoding]::Convert($encFrom, $encTo, $bytes) |
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 { NextResponse } from "next/server"; | |
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils"; | |
import { connectToDB } from "@/lib/mongoose"; | |
import Product from "@/lib/models/product.model"; | |
import { scrapeAmazonProduct } from "@/lib/scraper"; | |
import { generateEmailBody, sendEmail } from "@/lib/nodemailer"; | |
export const maxDuration = 300; // This function can run for a maximum of 300 seconds | |
export const dynamic = "force-dynamic"; |
NewerOlder