Skip to content

Instantly share code, notes, and snippets.

View Astro36's full-sized avatar

Seungjae Park Astro36

View GitHub Profile
@YodaEmbedding
YodaEmbedding / .clang-format
Last active July 18, 2024 17:20
.clang-format for Rust style (rustfmt)
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent # New in v14. For earlier clang-format versions, use AlwaysBreak instead.
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
/// @brief Helper function for using the `rapidcheck` under the `doctest`.
#pragma once
#include <doctest/doctest.h>
#include <rapidcheck.h>
#include <utility>
namespace rc {
template <typename Testable_>
const int mod = 998244353;
using lint = long long;
lint ipow(lint x, lint p){
lint ret = 1, piv = x;
while(p){
if(p & 1) ret = ret * piv % mod;
piv = piv * piv % mod;
p >>= 1;
}
return ret;
@HelloWorld017
HelloWorld017 / npmbrowse.user.js
Last active January 21, 2019 07:34
Add Files tab in npm
// ==UserScript==
// @name NPM Browse Files
// @namespace https://gist.github.com/HelloWorld017/3a5460ce41db861d4d0f4550289b10c7/
// @version 1.0
// @description Browse files on npm
// @author Khinenw
// @match *://*.npmjs.com/package/*
// @grant none
// ==/UserScript==
@luncliff
luncliff / cmake-tutorial.md
Last active July 16, 2024 13:09
CMake 할때 쪼오오금 도움이 되는 문서

CMake를 왜 쓰는거죠?
좋은 툴은 Visual Studio 뿐입니다. 그 이외에는 전부 사도(邪道)입니다 사도! - 작성자

주의

  • 이 문서는 CMake를 주관적으로 서술합니다
  • 이 문서를 통해 CMake를 시작하기엔 적합하지 않습니다
    https://cgold.readthedocs.io/en/latest/ 3.1 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다
@HelloWorld017
HelloWorld017 / ghost-seasons-background.js
Created February 7, 2017 10:49
Automated changing flat stripe background for ghost.
(function(){
//SVG Flat Stripe Background
//by Khinenw
//gist.github.com/HelloWorld017/6fb557767095a0e79140cb3bfbed83e7
'use strict';
if(location.pathname !== '/') return;
var themes = [[/^\d+-(02|03|04)-.+$/, ['#f8bbd0', '#f06292', '#e91e63', '#c2185b', '#880e4f']], //Haru
[/^\d+-(05|06|07)-.+$/, ['#ffeb3b', '#cddc39', '#8bc34a', '#4caf50', '#009688']], //Natsu
@nesffer
nesffer / bot.js
Last active November 9, 2019 11:54
텔레그램 봇 정각알림
const schedule = require('node-schedule');
schedule.scheduleJob('0 0 * * * *', () => {
var chatParticipantFile = fs.readFileSync('./chat_participant.txt', 'utf8');
var chatParticipant = chatParticipantFile.split('\n');
chatParticipant.forEach((element, index, array) => {
if (element) {
bot.sendMessage(element, '정각입니다.', {disable_notification: true});
}
});
@HelloWorld017
HelloWorld017 / tvple-download.md
Last active October 23, 2018 12:02
티비플을 다운로드해보자!

티비플을 다운로드 하는 방법

  1. 북마크에 아래의 url을 추가한다.
    `javascript:var href = $('#video-player video&gt;source').attr('src'); var content = $('meta[property=og\:title]').attr('content'); if(href !== undefined){ (function(src, title){ var popupContent = $(document.createElement('div')).append( $(document.createElement('h2')).text('%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%EA%B0%80 %EC%A4%80%EB%B9%84%EB%90%90%EC%8A%B5%EB%8B%88%EB%8B%A4!') ).append( $(document.createElement('h4')).text('%EC%95%84%EB%9E%98%EC%9D%98 %EB%A7%81%ED%81%AC%EB%A5%BC %EB%88%8C%EB%9F%AC %EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C %ED%95%98%EC%8B%AD%EC%8B%9C%EC%98%A4.') ).append( $(document.createElement('a')).attr('href', src).attr('download', title).text('%EB%8F%99%EC%98%81%EC%83%81 %EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C') ); createPopup(popupContent, '%EB%8F%99%EC%98%81%EC%83%81 %EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C'); })(href, content); }else{ createPopup( $(document.createElement('h2')).html('%EC%98%A4%EB%A5%98!
    %EB%8F%99%EC%98%81%EC%83%81 %ED%94%8C%EB%A0%88%
@HelloWorld017
HelloWorld017 / acacia.js
Created September 24, 2016 12:54
아카시아 로고 제작에 사용된 js
let get_xy = (x, y, radius, angle) => {
let rad = Math.PI / 180 * angle;
return {
x: Math.round(x + Math.cos(rad) * radius),
y: Math.round(y + Math.sin(rad) * radius)
};
};
let generate_flower = (x, y, radius, angle_base) => {
let str = '';