Skip to content

Instantly share code, notes, and snippets.

@brson
brson / a.md
Created April 15, 2016 21:37
Rust heap profiling with jemalloc

I've never done this but I've heard it works.

Configure the Rust build like make JEMALLOC_FLAGS=--enable-prof. You might also want --enable-prof-libunwind.

Then run your program with something lke MALLOC_CONF=prof:true and it should dump stats to files called "jeprof*.out". Then you use the jeprof tool, which I am not sure how to get, to interpret it.

Here's a page with some ideas.

@JamesMessinger
JamesMessinger / README.md
Last active May 9, 2025 07:46
VSCode GitHub Markdown Theme

GitHub Markdown Theme for Visual Studio Code

This CSS stylesheet allows you to preview markdown files in VSCode using GitHub's mardown theme. This CSS was taken directly from the official GitHub Markdown repo. I replaced their top-level .markdown-body class with the body tag so it would work in VSCode, and added styling for the html tag to match GitHub's fixed-width container.

Instructions

  1. Copy the CSS file to your computer
    Copy the github-markdown.css file below to your computer. You can put it anywhere you want, but I chose to put it in the same folder as my VSCode settings file.

  2. Edit your VSCode settings
    If you want to use this theme for all of your projects, then edit your User Settings file. If you just want to use this them

@troyk
troyk / db.go
Created November 12, 2015 23:17
golang sql query abstraction
package db
import (
"database/sql"
"log"
"strings"
"sync"
_ "github.com/lib/pq" // required for database/sql
"golang.org/x/net/context"
@brson
brson / gist:ad9cdfdec9a58a1f7fa2
Last active May 2, 2021 16:22
Rust IRC channels
#rust - Rust 24-hour partyline
#rust-internals - Compiler hackers
#rustc - Focused discussion on rustc internals
#rust-libs - Focused discussion on rust std libs
#rust-bots - Status updates
#cargo - Anything about Cargo
#servo - Anything about Servo
#rust-gamedev
#rust-offtopic
#rust-osdev
@onjin
onjin / slackme
Last active June 15, 2018 07:49
Send msgs to slack using incoming webhook
#!/usr/bin/env python
"""
Usage:
using ~/.slackmerc file:
$ slackme some info # with `default` profile
$ slackme --profile alert some info # using `alert` profile
put profile in filename:
@nl5887
nl5887 / transfer.fish
Last active July 30, 2024 09:21
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@zhwei
zhwei / gotit-doc.md
Last active August 29, 2015 14:05
Gotit 开放接口文档

Gotit 开放接口文档

  • 更新时间: 2014-05-05
  • 数据格式均为JSON
  • 接口使用说明:
    1. 由于中文验证码的存在, 接口或许有点另类, 希望见谅.
    2. 验证类接口需要登录后才能使用, 如果仅查询单项信息推荐使用下面的成绩类或课表类接口
    3. 开发者在使用接口前先通过邮件联系作者 索要accesstoken, 将其放入请求header中.
    4. 次数限制 1000次/小时, 防止端口被恶意使用, 如果配额不够请联系作者.
@vertexclique
vertexclique / cracking.md
Last active October 31, 2025 20:48
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@dfm
dfm / _chi2.c
Created August 3, 2012 13:41
How to wrap C code in Python
#include <Python.h>
#include <numpy/arrayobject.h>
#include "chi2.h"
/* Docstrings */
static char module_docstring[] =
"This module provides an interface for calculating chi-squared using C.";
static char chi2_docstring[] =
"Calculate the chi-squared of some data given a model.";
@olivierlacan
olivierlacan / git_log.md
Created August 2, 2012 15:06
My git log custom output aliases
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"

To check that they've been added correctly, first run git config --list. You should see something like this in the midst of all your other configuration:

alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short