Skip to content

Instantly share code, notes, and snippets.

View daramkun's full-sized avatar
🐿️

진재연(Jin Jae-yeon) daramkun

🐿️
View GitHub Profile
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@taktos
taktos / Log.php
Created May 22, 2012 02:15
PHP tail viewer
<?php
/**
* Require the library
*/
require 'PHPTail.php';
/**
* Initilize a new instance of PHPTail
* @var PHPTail
*/
$tail = new PHPTail("/path/to/log");
@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];
};
@Liryna
Liryna / ARMDebianUbuntu.md
Last active October 13, 2024 16:16
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

@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;
}
@mistic100
mistic100 / check-version.iss
Last active January 3, 2024 22:22
[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;
@bjornblissing
bjornblissing / CMakeManifest.txt
Last active July 30, 2024 22:12
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..."
@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;
@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';
@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;