Skip to content

Instantly share code, notes, and snippets.

View inaborges's full-sized avatar
🎯
Focusing

Marina Borges inaborges

🎯
Focusing
View GitHub Profile
@caiodelfava
caiodelfava / AntiAutonumber.cls
Last active January 9, 2023 04:04
This class aims to be an alternative to Autonumber setting on text field type, offering methods to copy data from other fields avoiding exceed field length by abbreviating the content with...
/**
* @description : This class aims to be an alternative to Autonumber setting on
* text field type, offering methods to copy data from other fields
* avoiding exceed field length by abbreviating the content with...
* @author : caiodelfava@gmail.com
* @group : Lightning Cloud Hidden Village
* @last modified on : 2022-11-30
* @last modified by : caiodelfava@gmail.com
* Modifications Log
* Ver Date Author Modification
# names of hurricanes
names = ['Cuba I', 'San Felipe II Okeechobee', 'Bahamas', 'Cuba II', 'CubaBrownsville', 'Tampico', 'Labor Day',
'New England', 'Carol', 'Janet', 'Carla', 'Hattie', 'Beulah', 'Camille', 'Edith', 'Anita', 'David',
'Allen', 'Gilbert', 'Hugo', 'Andrew', 'Mitch', 'Isabel', 'Ivan', 'Emily', 'Katrina', 'Rita', 'Wilma',
'Dean', 'Felix', 'Matthew', 'Irma', 'Maria', 'Michael']
# months of hurricanes
months = ['October', 'September', 'September', 'November', 'August', 'September', 'September', 'September',
'September', 'September', 'September', 'October', 'September', 'August', 'September', 'September',
'August', 'August', 'September', 'September', 'August', 'October', 'September', 'September', 'July',
@shu0924
shu0924 / Carly's Clippers.py
Created October 26, 2018 09:39
Carly's Clippers
hairstyles = ["bouffant", "pixie", "dreadlocks", "crew", "bowl", "bob", "mohawk", "flattop"]
prices = [30, 25, 40, 20, 20, 35, 50, 35]
last_week = [2, 3, 5, 8, 4, 4, 6, 2]
total_price = 0
for price in prices:
total_price += price
average_price = total_price / len(prices)
print("Average Haircut Price : " + str(average_price))
@udacityandroid
udacityandroid / Code snippet from MainActivity.java
Last active February 6, 2023 14:25
Android for Beginners : Negative Number of Cups of Coffee Extra Challenge Solution
/**
* This method is called when the plus button is clicked.
*/
public void increment(View view) {
if (quantity == 100) {
// Show an error message as a toast
Toast.makeText(this, "You cannot have more than 100 coffees", Toast.LENGTH_SHORT).show();
// Exit this method early because there's nothing left to do
return;
}
@udacityandroid
udacityandroid / Code snippet in InboxActivity.java
Last active February 6, 2023 13:53
Android for Beginners : If/Else Email Quiz
int numberOfEmailsInInbox = 0;
int numberOfDraftEmails = 2;
String emailMessage = "You have " + numberOfEmailsInInbox + " emails. ";
String draftMessage = "You have " + numberOfDraftEmails + " email drafts.";
if (numberOfEmailsInInbox == 0) {
emailMessage = "You have no new messages. ";
}
if (numberOfDraftEmails == 0) {
draftMessage = "You have no new drafts.";
@mxalix258
mxalix258 / Visualforce Extension Test
Created June 26, 2013 01:19
Method for testing a visualforce extension and controller methods.
@isTest
//class name
private class vacationdaysTEST{
//test method
private static testMethod void vacationdaysTEST(){
//instantiate the object on which the extension is defined.
Leave_Request__c lr = new Leave_Request__c();
//instantiate standardcontroller, pass object variable into constructor
ApexPages.StandardController sc = new ApexPages.StandardController(lr);
//instantiate extension controller, pass standard controller variable into constructor
@alopes
alopes / stopwords.txt
Created April 10, 2013 20:32
Portuguese stop words
de
a
o
que
e
do
da
em
um
para