Skip to content

Instantly share code, notes, and snippets.

@Junch
Junch / restart-ssh
Created September 28, 2021 07:18 — forked from influx6/restart-ssh.bash
Restart SSH on Mac Terminal (High Sierra)
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
@Junch
Junch / git-apply-patch.md
Created February 19, 2021 03:19 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@Junch
Junch / mymath.py
Created February 4, 2021 04:04 — forked from ethanwhite/mymath.py
Simple Python nose testing example
from __future__ import division
def add(num1, num2):
assert type(num1) == int or type(num1) == float
assert type(num2) == int or type(num2) == float
return num1 + num2
def divide(numerator, denominator):
return numerator / denominator
@Junch
Junch / stack_traces.c
Created June 18, 2020 03:25 — forked from jvranish/stack_traces.c
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@Junch
Junch / git-key.md
Created January 19, 2019 14:30 — forked from yisibl/git-key.md
如何创建 Git 公钥

如何创建公钥

  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

@Junch
Junch / gist:9ed95e394164703a6bb9c732962f8f00
Created January 4, 2019 07:49 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Junch
Junch / conversion.cpp
Created July 17, 2018 08:15 — forked from pezy/conversion.cpp
Encoding Conversion In C++
// Convert a wide Unicode string to an UTF8 string
std::string utf8_encode(const std::wstring &wstr)
{
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
std::string strTo(size_needed, 0);
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
return strTo;
}
// Convert an UTF8 string to a wide Unicode String
@Junch
Junch / README-Highcharts-Webpack-Babel.md
Created January 4, 2018 07:25 — forked from jon-a-nygaard/README-Highcharts-Webpack-Babel.md
A Highcharts example in use with Webpack and Babel.

A Highcharts example in use with Webpack and Babel.

Install

  1. Download source files
  2. Run npm install to install all dependencies.
  3. Run npm run build to bundle app.js into bundle.js

Open application

  1. Open index.html in a browser.
@Junch
Junch / pdbdump.c
Created July 20, 2017 07:14 — forked from mridgers/pdbdump.c
Small tool to list and query symbols in PDB files.
//------------------------------------------------------------------------------
// pdbdump.c - dump symbols from .pdb and executable files (public domain).
// - to compile; cl.exe /Ox /Zi pdbdump.c
// -
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk
//------------------------------------------------------------------------------
#include <stdio.h>
#include <Windows.h>
#include <DbgHelp.h>
@Junch
Junch / .gitignore
Created April 28, 2017 11:21 — forked from BennettSmith/.gitignore
gtest-1.7.0 build script
gtest