Skip to content

Instantly share code, notes, and snippets.

View joonhwan's full-sized avatar
🏠
Working from home

joonhwan joonhwan

🏠
Working from home
View GitHub Profile
@kristofferh
kristofferh / git-export
Created December 7, 2011 13:01
"Export" a git repository to zip file
git archive --format zip --output /full/path/to/zipfile.zip master
@rippinrobr
rippinrobr / gist:3241701
Created August 2, 2012 23:04
updated app.config file to add Npgsql as a data provider for this app.
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<connectionStrings>
<add name="hockeydb"
connectionString="Server=127.0.0.1;Port=5432;Database=hockeydb;User Id=demo;Password=demo;"
providerName="Npgsql"
/>
</connectionStrings>
<system.data>
@robfe
robfe / Hubs.tt
Last active March 18, 2020 16:17
T4 template that creates Typescript type definitions for all your Signalr hubs. If you have C# interface named "I<hubName>Client", a TS interface will be generated for the hub's client too.If you turn on XML documentation in your build, XMLDoc comments will be picked up.Licensed with http://www.apache.org/licenses/LICENSE-2.0
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".d.ts" #>
<# /* Update this line to match your version of SignalR */ #>
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll" #>
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #>
<#@ assembly name="$(TargetPath)" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Web" #>
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
@ianmac45
ianmac45 / qsettings-xml.hpp
Last active November 29, 2023 07:03
XML Format for QSettings
#pragma once
//TODO include appropriate headers
#include <QtCore/QtCore>
#include <QtXml/QtXml>
bool readSettingsXml(QIODevice &device, QMap<QString, QVariant> &map);
bool writeSettingsXml(QIODevice &device, const QMap<QString, QVariant> &map);
static const QSettings::Format xmlFormat = QSettings::registerFormat("xml", &readSettingsXml, &writeSettingsXml);
static const QString rootName = "config";
@lionicsheriff
lionicsheriff / devenv-compile.el
Last active October 7, 2016 16:19
Emacs: Compile visual studio projects from within emacs (M-x compile)
(defun mbg/devenv-compile nil
"Set up compile command for Visual Studio"
(interactive)
(let ((vsvars (shell-quote-argument "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\vsvars32.bat"))
(solution-file (shell-quote-argument
;; awesomely, locate-dominating-file returns the directory for the file
;; so when you use a pattern to find a file, you need to run it again in
;; the directory itself to get the file name. Who knew.
(car (directory-files
(locate-dominating-file default-directory
@hensing
hensing / python_logging.c
Last active June 14, 2024 17:08
Python: Use 'logging' module from C extension
#include <Python.h>
/***********************************************************/
/* define logging function and logtypes for python.logging */
/* by H.Dickten 2014 */
/***********************************************************/
enum logtypes {info, warning, error, debug};
static void log_msg(int type, char *msg)
{
@tejacques
tejacques / HOCBaseRender.tsx
Last active May 2, 2022 13:05
React Higher Order Components in TypeScript
import * as React from 'react';
import { Component } from 'react';
export default function HOCBaseRender<Props, State, ComponentState>(
Comp: new() => Component<Props & State, ComponentState>) {
return class HOCBase extends Component<Props, State> {
render() {
return <Comp {...this.props} {...this.state}/>;
}
}
@dmmiller612
dmmiller612 / tensorflow_json.py
Created December 11, 2017 15:58
Tensorflow Graph and weights to json and back for training
import tensorflow as tf
import numpy as np
from google.protobuf import json_format
import json
np.random.seed(12345)
def tensorflow_get_weights():
"""
@illume
illume / flask_matplotlib.py
Last active September 21, 2022 02:14
Shows how to use flask and matplotlib together.
""" Shows how to use flask and matplotlib together.
Shows SVG, and png.
The SVG is easier to style with CSS, and hook JS events to in browser.
python3 -m venv venv
. ./venv/bin/activate
pip install flask matplotlib
python flask_matplotlib.py
"""
@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 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다