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
[alias] | |
clean-branch = !git fetch -p | git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D |
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
git config --global init.defaultBranch main |
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
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
for i1, num1 in enumerate(nums): | |
for i2, num2 in enumerate(nums[i1+1:]): | |
if target == (num1 + num2): | |
return [i1, i2 + i1 + 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
class AwsLambdaClient { | |
val aws_access_key_id = "<YOUR_ACCESS_KEY_PASTE_HERE>" | |
val aws_secret_access_key = "<YOUR_SECRET_KEY_PASTE_HERE>" | |
val region = "ap-northeast-1" | |
val function_name = "test_func" | |
fun invoke() { | |
val payload = """ | |
{ | |
"token": "TOKEN", |
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 sys | |
sys.path.append(path.normpath(path.join(path.dirname(path.abspath( __file__ )), '..'))) |
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 deleteOldMail() { | |
var sheet = SpreadsheetApp.getActive().getSheetByName('label'); | |
for(var row=2; row<=sheet.getLastRow(); row++){ | |
var labelName = sheet.getRange(row, 1).getValue(); | |
var days = sheet.getRange(row, 2).getValue(); | |
var deleteThreads = GmailApp.search('older_than:'+days+'d -is:starred label:'+ labelName); | |
for (var i = 0; i < deleteThreads.length; i++) { | |
deleteThreads[i].moveToTrash(); | |
} |
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 json | |
import requests | |
import urllib | |
import sys | |
from xml.etree import ElementTree | |
doItAgain = "yes" #Control While loop | |
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 math | |
n = 100 | |
digits = int(math.log10(n) + 1) # 3 |
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
var request = require('request'); | |
var fs = require('fs'); | |
const SLACK_BOT_TOKEN = 'hogehoge'; | |
const api_url = 'https://slack.com/api/'; | |
var fileName = 'hogefuga.png'; | |
var channel = 'general'; | |
options = { | |
token: SLACK_BOT_TOKEN, | |
filename: fileName, |
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
SELECT | |
protoPayload.authenticationInfo.principalEmail AS email, | |
ROUND(SUM(protoPayload.serviceData.jobCompletedEvent.job.jobStatistics.totalBilledBytes) /1000000000, 3) AS total_GBytes, | |
protoPayload.serviceData.jobCompletedEvent.job.jobStatistics.billingTier AS billing_tier, | |
COUNT(protoPayload.serviceData.jobCompletedEvent.job.jobConfiguration.query.query) AS query_count, | |
protoPayload.serviceData.jobCompletedEvent.job.jobConfiguration.query.query AS query_string, | |
FROM | |
TABLE_DATE_RANGE(AuditLogs.cloudaudit_googleapis_com_data_access_, DATE_ADD(CURRENT_TIMESTAMP(), -7, 'DAY'), CURRENT_TIMESTAMP()) | |
WHERE | |
protoPayload.serviceData.jobCompletedEvent.eventName = 'query_job_completed' |
NewerOlder