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
const fetch = require("node-fetch") | |
const { JSDOM } = require("jsdom") | |
const fetchHtml = async (url) => { | |
const response = await fetch(url) | |
const text = await response.text() | |
const dom = new JSDOM(text) | |
return dom.window.document | |
} |
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
const twilio = require("twilio") | |
const accountSid = "<MY_TWILIO_ACCOUNT_SID>" | |
const authToken = "<MY_TWILIO_AUTH_TOKEN>" | |
const client = new twilio(accountSid, authToken) | |
client.messages.create({ | |
body: "Hello from Node.js", | |
to: "<TARGET_PHONE_NUMBER>", | |
from: "<MY_TWILIO_PHONE_NUMBER>" | |
}).then((message) => console.log(message.sid)) |
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
const array = ['a', 'b', 'c'] | |
const current = 0 | |
const last = array.length - 1 | |
const prev = (current === 0) ? last : current-1 | |
const next = (current === last) ? 0 : current+1 |
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
/* | |
Usage | |
----- | |
1. Copy and paste the jobr() function below into a new text file, and update the "tasks" array to use your own tasks. | |
2. Go to Jobr in Chrome (or probably any other browser). | |
2. Select the day you're entering time for. |
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
const numbers = [1, 3, 5, 1, 23, 5] | |
// Adds two args | |
const add = (one, two) => one + two | |
// Compute sum of the collection | |
const sum = numbers.reduce((sum, number) => add(sum, number)) | |
// Multiplies two args | |
const multiply = (one, two) => one * two |
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
const input = [ | |
{ | |
"id": "b297ed8f-ad81-5988-a08e-b4ec51428981", | |
"questionBody": "What generations are you primarily serving?", | |
"questionAnswers": [ | |
"Gen Z (1997-on)", | |
"Millennials (1981-1997)", | |
"Gen X (1965-1980)", | |
"Boomers (1946-1964)" | |
], |
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
const vars = [ | |
// nav | |
"$nav-bg-color", | |
"$nav-text-color", | |
"$nav-default-height", | |
"$nav-font-family", | |
"$nav-border-bottom", | |
"$nav-box-shadow", | |
"$nav-link-color", | |
"$nav-link-color-hover", |
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
// via https://medium.com/react-weekly/implementing-graphql-in-your-redux-app-dad7acf39e1b | |
import { | |
LOAD_EMPLOYEE_DATA_INITIATION, | |
LOAD_EMPLOYEE_DATA_SUCCESS, | |
LOAD_EMPLOYEE_DATA_FAILURE, | |
} from './constants'; | |
export const employeeUrl = 'http://0.0.0.0:1338/api/employees'; | |
// loadEmployeeDataInitiation :: None -> {Action} | |
export const loadEmployeeDataInitiation = () => ({ |
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 com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.event.type.EventDispatchOption | |
import com.atlassian.jira.issue.CustomFieldManager | |
import com.atlassian.jira.issue.MutableIssue | |
import com.atlassian.jira.issue.IssueManager | |
import java.util.ArrayList | |
import com.atlassian.jira.user.ApplicationUser | |
import org.apache.log4j.Logger | |
def log = Logger.getLogger("com.acme.XXX") |
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 examples.docs | |
import com.atlassian.applinks.api.ApplicationLink | |
import com.atlassian.applinks.api.ApplicationLinkService | |
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType | |
import com.atlassian.sal.api.component.ComponentLocator | |
import com.atlassian.sal.api.net.Request | |
import com.atlassian.sal.api.net.Response | |
import com.atlassian.sal.api.net.ResponseException | |
import com.atlassian.sal.api.net.ResponseHandler |