Skip to content

Instantly share code, notes, and snippets.

View daramkun's full-sized avatar
๐Ÿฟ๏ธ

์ง„์žฌ์—ฐ(Jin Jae-yeon) daramkun

๐Ÿฟ๏ธ
View GitHub Profile
@rplacd
rplacd / optimus.md
Last active December 10, 2024 17:01
Enabling Optimus on your desktop Nvidia GPU.

Enabling Optimus support for your desktop GPU

Windows 10 users: you won't need this guide. NVidia has made signed drivers available with the modifications outlined here, although it's been said you'll have to get them from third-party vendors - distributing them like they do with notebook GPU drivers. I use drivers bundled with the Razer Core enclosure.

@vandersonarruda
vandersonarruda / simplegamecenter.cs
Last active March 19, 2024 05:43 — forked from coreyjs/simplegamecenter.cs
Unity3d Simple GameCenter Integration
using UnityEngine;
using System.Collections;
using UnityEngine.SocialPlatforms;
using UnityEngine.SocialPlatforms.GameCenter;
public class GameCenter : MonoBehaviour {
static ILeaderboard m_Leaderboard;
public int highScoreInt = 1000;
@tgjones
tgjones / HlslAntlrLexer.g4
Created May 25, 2015 10:17
ANTLR4 grammar for HLSL
lexer grammar HlslAntlrLexer;
@lexer::header {#pragma warning disable 3021}
AppendStructuredBuffer : 'AppendStructuredBuffer';
Bool : 'bool';
Bool1 : 'bool1';
Bool2 : 'bool2';
Bool3 : 'bool3';
Bool4 : 'bool4';
@shlee322
shlee322 / check_password.js
Created February 17, 2015 04:28
๊ฐœ์ธ์ •๋ณด์˜ ๊ธฐ์ˆ ์ ยท๊ด€๋ฆฌ์  ๋ณดํ˜ธ์กฐ์น˜ ๊ธฐ์ค€์— ๋”ฐ๋ฅธ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ž‘์„ฑ ๊ทœ์น™ ์ฒดํฌ ํ•จ์ˆ˜
function check_password(pwd) {
// Copyright (c) 2015 Lee Sahghyuck <shlee322@elab.kr>
// MIT License (http://opensource.org/licenses/mit-license.php)
// Author : Lee Sahghyuck <shlee322@elab.kr>
// Date : 2015.02.17
var char_type = 0;
if (/[a-z]/.test(pwd)) char_type = char_type + 1;
if (/[A-Z]/.test(pwd)) char_type = char_type + 1;
if (/[0-9]/.test(pwd)) char_type = char_type + 1;
@bjornblissing
bjornblissing / CMakeManifest.txt
Last active September 22, 2026 00:16
CMake script to add manifest to exe-file
# Amend manifest to tell Windows that the application is DPI aware (needed for Windows 8.1 and up)
IF (MSVC)
IF (CMAKE_MAJOR_VERSION LESS 3)
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
ELSE()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_TARGETNAME}
POST_BUILD
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaleing.manifest\" -inputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${TARGET_TARGETNAME}>\"\;\#1
COMMENT "Adding display aware manifest..."
@mistic100
mistic100 / check-version.iss
Last active May 8, 2025 12:23
[InnoSetup] Prevent install if newer version is already installed
#define AppId "{INSERT HERE YOUR GUID}"
#define AppName "My App"
#define AppVersion "1.7"
[CustomMessages]
english.NewerVersionExists=A newer version of {#AppName} is already installed.%n%nInstaller version: {#AppVersion}%nCurrent version:
[Code]
// find current version before installation
function InitializeSetup: Boolean;
var Version: String;
@alghanmi
alghanmi / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@Liryna
Liryna / ARMDebianUbuntu.md
Last active March 18, 2026 18:48
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@ujentus
ujentus / RIOServer_sm9.cpp
Created July 15, 2013 02:11
Windows Registered I/O (RIO) Sample Code (Echo Server)
/*********************************************************************************************************
* Windows Registered I/O (RIO) Sample Code (Echo Server)
* Minimum requirement: Windows 8 or Windows Server 2012
* Author: @sm9kr
*
* Notice
* ๋ช‡๋ช‡ ์ฝ”๋“œ ์กฐ๊ฐ๋“ค์€ (http://www.serverframework.com/asynchronousevents/rio/)์—์„œ ๊ฐ€์ ธ์˜ด.
* ๊ทธ๋Ÿฐ๋ฐ ์—ฌ๊ธฐ๋„ ์ œ๋Œ€๋กœ ์™„์„ฑ๋œ ์ฝ”๋“œ๊ฐ€ ์žˆ์—ˆ๋˜ ๊ฒƒ์€ ์•„๋‹ˆ๋ผ์„œ ์ƒ๋‹น ๋ถ€๋ถ„ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๋™์ž‘ํ•˜๋„๋ก ํ•จ.
* RIO์˜ ์‚ฌ์šฉ๋ฒ•์„ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•œ ์ฝ”๋“œ๋ผ ์ตœ๋Œ€ํ•œ ๊ฐ„๋‹จํ•˜๊ฒŒ ํ•„์š”ํ•œ ๋ถ€๋ถ„๋งŒ ๋„ฃ์—ˆ์Œ.
* ๊ทธ๋ž˜์„œ, ๋ฒ„๊ทธ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Œ...
@rygorous
rygorous / gist:4172889
Created November 30, 2012 00:28
SSE/AVX matrix multiply
#include <immintrin.h>
#include <intrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
union Mat44 {
float m[4][4];
__m128 row[4];
};