Skip to content

Instantly share code, notes, and snippets.

View taeguk's full-sized avatar
😈
BAAAD

taeguk | thai taeguk

😈
BAAAD
View GitHub Profile
@taeguk
taeguk / EC++48.cpp
Last active May 30, 2016 19:37
EC++ no.48 my example.
#include <iostream>
template <unsigned N>
struct IsPrime {
static_assert(N >= 2, "The number must not be less than 2.");
IsPrime() = delete;
static bool value() { return static_cast<bool>(_value); }
private:
@taeguk
taeguk / EC++47.cpp
Created May 30, 2016 14:10
EC++ no.47 my example
#include <iostream>
// νŠΉμ„±μ •λ³΄μ— λŒ€ν•œ tagλ“€.
struct walk_ability_tag {};
struct jump_ability_tag {};
struct fly_ability_tag {};
struct run_ability_tag :public walk_ability_tag {};
struct ground_ability_tag :public run_ability_tag, public jump_ability_tag {};
struct all_ability_tag :public ground_ability_tag, public fly_ability_tag {};
@lrascao
lrascao / gist:f57312ff33b799c4c0db56b10e80fe26
Created March 31, 2016 16:19
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
@baldurk
baldurk / sourceindex.md
Last active January 25, 2025 19:00
Source indexing for github projects

Symbol Servers

I'm assuming you are familiar with symbol servers - you might not have one set up yourself for your own projects, but you probably use Microsoft's public symbol server for downloading symbols for system DLLs.

For your own projects it might be useful to set up a symbol server - I won't go into how you do that here since it's well documented elsewhere, but basically you just set up a folder somewhere - say X:\symbols\ or \servername\symbols or even http://servername.foo/symbols/ which has a defined tree structure:

symbols/
symbols/mymodule.pdb/
symbols/mymodule.pdb/123456789012345678901234567890122/
#include <thread>
#include <future>
#include <exception>
#include <chrono>
#include <iostream>
class interrupt_flag
{
std::atomic<bool> flag;
std::condition_variable* thread_cond;
@taeguk
taeguk / lock.cpp
Last active March 26, 2024 08:41
Lock/Unlock Session by the "computer using rule" in Windows.
/*
Lock/Unlock Session by the "computer using rule".
Support versions >= Windows 7
https://gist.github.com/taeguk/13b607f42020981f6cf9
*/
#include <windows.h>
#include <stdio.h>
#include <time.h>
#include <Wtsapi32.h>
@haje01
haje01 / TensorFlow μ‹œμž‘ν•˜κΈ°.md
Last active May 3, 2024 07:30
TensorFlow μ‹œμž‘ν•˜κΈ°

ν…μ„œν”Œλ‘œμš° μ‹œμž‘ν•˜κΈ°

글쓴이: κΉ€μ •μ£Ό([email protected])

이 λ¬Έμ„œλŠ” ν…μ„œν”Œλ‘œμš° 곡식 νŽ˜μ΄μ§€ λ‚΄μš©μ„ λ°”νƒ•μœΌλ‘œ λ§Œλ“€μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€.


μ†Œκ°œ

ν…μ„œν”Œλ‘œμš°(TensorFlow)λŠ” 기계 ν•™μŠ΅κ³Ό λ”₯λŸ¬λ‹μ„ μœ„ν•΄ κ΅¬κΈ€μ—μ„œ λ§Œλ“  μ˜€ν”ˆμ†ŒμŠ€ λΌμ΄λΈŒλŸ¬λ¦¬μž…λ‹ˆλ‹€. 데이터 ν”Œλ‘œμš° κ·Έλž˜ν”„(Data Flow Graph) 방식을 μ‚¬μš©ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

@gigiigig
gigiigig / auxpattern.scala
Last active January 8, 2025 00:31
Aux Pattern
import shapeless._
import scalaz._
import Scalaz._
object console extends App {
trait Foo[A] {
type B
def value: B
@nickautomatic
nickautomatic / cmder.md
Last active December 16, 2024 05:11
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
@aaronhurt
aaronhurt / curltest.c
Last active February 13, 2025 15:51
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* License:
*
* This code is licensed under MIT license
* https://opensource.org/licenses/MIT
*