Skip to content

Instantly share code, notes, and snippets.

View Lanace's full-sized avatar

Jeonilju Lanace

View GitHub Profile
@Lanace
Lanace / gist:d480c8c04ebd09d991e9f93d7d8d7881
Created July 18, 2022 02:39
네이버폼 설문 조작용 코드
const evt1 = document.createEvent('MouseEvents');
evt1.initMouseEvent('mousedown', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
const evt = document.createEvent('MouseEvents');
evt.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
for (let a = 1; a < 20; a++) {
const rand = Math.floor(Math.random() * 2) + 3;
const element = document.getElementById(`radio_label_${a}_${rand}`);
@Lanace
Lanace / ScrollViewPager.java
Created January 19, 2017 02:12
Disable horizontal scroll in ViewPager
public class CustomViewPager extends ViewPager {
private boolean isPageScrollEnabled = true;
public CustomViewPager(Context context) {
super(context);
}
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
@Lanace
Lanace / open-graph.html
Created July 12, 2018 01:54
open-graph.html 설정
<!-- Twitter Cards -->
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
{% if page.excerpt %}<meta name="twitter:description" content="{{ page.excerpt | strip_html }}">{% endif %}
{% if site.owner.twitter %}<meta name="twitter:site" content="@{{ site.owner.twitter }}">{% endif %}
{% if author.twitter %}<meta name="twitter:creator" content="@{{ author.twitter }}">{% endif %}
{% if page.image.feature %}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}">
{% else %}
<meta name="twitter:card" content="summary">
@Lanace
Lanace / default.html
Created July 12, 2018 01:53
Jekyll에 default.html에다 open graph 적용하기
<head>
<meta charset="utf-8">
<title>{% if page.title %}{{ page.title }} • {% endif %}{{ site.title }}</title>
{% if page.excerpt %}<meta name="description" content="{{ page.excerpt | strip_html }}">{% endif %}
{% if page.tags %}<meta name="keywords" content="{{ page.tags | join: ', ' }}">{% endif %}
{% if page.author %}
{% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.owner %}
{% endif %}
{% include open-graph.html %}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.lanace.myapplication"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
@Lanace
Lanace / StringCompareExample.java
Created October 1, 2017 01:43
String간에 문자열 비교 예제
public class StringCompareExample {
public static void main(String args[]) {
String a = "test";
String b = "test";
if (a == b) {
System.out.println("같음");
} else {
System.out.println("다름");
@Lanace
Lanace / App.java
Last active August 31, 2017 07:19
Swing Window 창 띄우기
import javax.swing.*;
public class App {
private JPanel jPanel;
public static void main(String args[]) {
JFrame frame = new JFrame("App");
frame.setContentPane(new App().jPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
package com.lanace.kotlinexample
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/nameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@Lanace
Lanace / MainActivity.java
Created July 19, 2017 02:59
스크롤뷰에서 버튼을 클릭했을 때 스크롤의 최 상단으로 이동시키는 코드
public class MainActivity extends AppCompatActivity {
Button button;
ScrollView scrollView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);