Skip to content

Instantly share code, notes, and snippets.

{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.*) line ([0-9]*)",
"selector": "source.perl"
}
@myd7349
myd7349 / cvs2git.md
Created May 9, 2020 07:04 — forked from tobiasvl/cvs2git.md
Convert CVS repo to Git
#include <iostream>
#include <hdf5.h>
// Constants
const char saveFilePath[] = "test.h5";
const hsize_t ndims = 2;
const hsize_t ncols = 3;
int main()
@myd7349
myd7349 / gist:a4935f0891e196a2ab51c2c35acc1c2b
Created April 10, 2021 14:50 — 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:
@myd7349
myd7349 / recompress_hdf5.py
Created June 16, 2021 06:13 — forked from janpipek/recompress_hdf5.py
Create a copy of HDF5 with compressed everything that could be compressed.
import h5py
import os
def _report(operation, key, obj):
type_str = type(obj).__name__.split(".")[-1].lower()
print "%s %s: %s." % (operation, type_str, key)
def h5py_compatible_attributes(in_object):
'''Are all attributes of an object readable in h5py?'''
try:
@myd7349
myd7349 / curl_jsoncpp_example.cpp
Created August 18, 2021 10:08 — forked from connormanning/curl_jsoncpp_example.cpp
Curl HTTP GET and JsonCpp parsing - basic functionality
#include <cstdint>
#include <iostream>
#include <memory>
#include <string>
#include <curl/curl.h>
#include <json/json.h>
namespace
{
@myd7349
myd7349 / curlget.cpp
Created October 8, 2021 01:01 — forked from whoshuu/curlget.cpp
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
The following trivial example program uses getopt() to handle two program options: -n, with no associated value; and -t val, which expects an associated value.
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
int flags, opt;
@myd7349
myd7349 / is_wireless.c
Created November 24, 2021 08:38 — forked from edufelipe/is_wireless.c
C example code to list all network interfaces and check whether they are wireless or not. Linux only. Tested on Ubuntu 10.04 and 12.04, but should be compatible with pretty much everything out there.
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <ifaddrs.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/wireless.h>
@myd7349
myd7349 / douban.py
Created December 29, 2021 00:42 — forked from yihong0618/douban.py
import requests
API = "https://api.wmdb.tv/api/v1/top?type={movie_type}&skip=0&limit={limit}"
def get_top_movies(movie_type, limit=250):
r = requests.get(API.format(movie_type=movie_type, limit=limit))
if not r.ok:
raise Exception(f"Can not get movies for {movie_type} type")
return r.json()