Skip to content

Instantly share code, notes, and snippets.

View rubysoho07's full-sized avatar

Yungon Park rubysoho07

View GitHub Profile
@rubysoho07
rubysoho07 / caliper_test.py
Created August 29, 2020 07:40
Example of creating and sending Caliper Analytics data
import pprint
from datetime import datetime
import caliper
from caliper import events, entities
from caliper.constants import CALIPER_ACTIONS
sensor_config = caliper.HttpOptions(
@rubysoho07
rubysoho07 / windows_configuration.ps1
Last active September 4, 2022 11:32
Windows 설정
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install packages related with programming
choco install -y firefox git.install vscode
choco install -y python3 golang jetbrainstoolbox
choco install -y dbeaver sourcetree rancher-desktop
choco install -y steam bandizip gimp powertoys notion
@rubysoho07
rubysoho07 / dynamodb_test.py
Created September 29, 2019 10:12
DynamoDB Test with Python
import boto3
dynamodb = boto3.resource('dynamodb', region_name='ap-northeast-2')
# Create table
table = dynamodb.create_table(
TableName="Movies",
KeySchema=[
{
'AttributeName': 'year',
@rubysoho07
rubysoho07 / step_functions_activity.py
Last active October 4, 2018 14:13
AWS Step Functions Activity 예제
import boto3
import json
client = boto3.client('stepfunctions')
# Activity가 수행되기를 기다린다.
response = client.get_activity_task(
activityArn='Activity의 ARN',
workerName='TestWorker'
)
@rubysoho07
rubysoho07 / xapi_statement.py
Last active July 9, 2018 10:51
xAPI Example 2. Statement
from tincan import Agent, Verb, Activity, ActivityDefinition, LanguageMap, Statement
statement = Statement(
actor=Agent(
name="Test User",
mbox="mailto:test@example.org"
),
verb=Verb(
id="https://brindlewaye.com/xAPITerms/verbs/loggedin/",
display=LanguageMap({'en-us': 'Log In'})
@rubysoho07
rubysoho07 / xapi_actor_verb_object.py
Last active July 29, 2018 03:24
xAPI Example 1. Actor, Verb, Object
from tincan import Agent, Verb, Activity, ActivityDefinition, LanguageMap
# Agent (Check: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#242-actor)
actor = Agent(
name="Test User",
mbox="mailto:test@example.org"
)
print actor.to_json()
@rubysoho07
rubysoho07 / caliper_event.py
Last active August 3, 2018 13:45
Caliper Example 2. Describing Event
import datetime
from caliper import entities, events
from caliper.constants import CALIPER_ACTIONS
event = events.SessionEvent(
actor=entities.Person(id='http://example.org/person/123', name='Test'),
action=CALIPER_ACTIONS['LOGGED_IN']
object=entities.SoftwareApplication(id='http://example.org/app/testservice', name='Learning Analytics Example'),
eventTime=datetime.datetime.utcnow().isoformat(timespec='milliseconds') + 'Z'
)
@rubysoho07
rubysoho07 / caliper_actor_action_object.py
Last active July 29, 2018 03:24
Caliper Example 1. Actor, Action, Object
from caliper import entities
# actor: 'Subject' part of an Event
actor = entities.Person(
id='http://example.org/person/123',
name='Test'
)
print(actor.as_json(thin_context=True, thin_props=True))
@rubysoho07
rubysoho07 / test.go
Created June 18, 2018 14:18
Testing AWS SDK for Go (Listing S3 Bucket)
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)