Skip to content

Instantly share code, notes, and snippets.

View karthikeyann's full-sized avatar

Karthikeyan karthikeyann

View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active May 13, 2025 18:59
Quantopian Lectures Saved
@bad-ed
bad-ed / template_traits.hpp
Created November 30, 2018 10:47
C++ traits for templates with type arguments (is_template, is_instance_of_template, is_derived_of_template)
#include <type_traits>
// Determine if `Instance` is instantiation of template
// e.g. static_assert(is_template<std::vector<int>>::value);
template<class Instance> struct is_template : std::false_type {};
template<class ...TemplateArgs, template<class...> class Template>
struct is_template<Template<TemplateArgs...>> : std::true_type {};
// Determine if `Instance` is instance of `Template`
// e.g. static_assert(is_instance_of_template<std::vector, std::vector<int>>::value);
@harrism
harrism / Recurrence.cu
Last active December 1, 2021 11:46
Using Thrust for the Taylor series approximation of 1 / (1-x). Demonstrates evaluating recurrences in parallel with a scan using Thrust running on CUDA.
#include <thrust/scan.h>
#include <thrust/device_vector.h>
#include <thrust/fill.h>
#include <vector>
#include <algorithm>
#include <cstdlib>
int main(int argc, char **argv)
{
using T = double;
; ----------------------------------------------------------------------------------------------------------------------
; Name ..........: TrayIcon library
; Description ...: Provide some useful functions to deal with Tray icons.
; AHK Version ...: AHK_L 1.1.13.01 x32/64 Unicode
; Original Author: Sean (http://goo.gl/dh0xIX) (http://www.autohotkey.com/forum/viewtopic.php?t=17314)
; Update Author .: Cyruz (http://ciroprincipe.info) (http://ahkscript.org/boards/viewtopic.php?f=6&t=1229)
; Mod Author ....: Fanatic Guru
; License .......: WTFPL - http://www.wtfpl.net/txt/copying/
; Version Date...: 2014 - 01 - 16
; Note ..........: Many people have updated Sean's original work including me but Cyruz's version seemed the most straight
@angstwad
angstwad / dict_merge.py
Last active December 22, 2024 16:02
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 14, 2025 04:34
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 13, 2025 09:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

<?php
/**
* Gmail経由でメール送信
* 要Pear::Mail
* @param string $to 送信先
* @param string $from 送信元
* @param string $bcc BCC
* @param string $subj 件名
* @param string $body メール本文
* @return bool trueでメール送信完了
@netj
netj / memusg
Last active February 20, 2025 18:08
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <[email protected]>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@luanlmd
luanlmd / email.php
Created April 16, 2010 18:27
Sending email with PEAR Mail class
<?php
include("Mail.php");
//$headers['Reply-to'] = "$name <$email>";
$headers['From'] = '[email protected]';
$headers['Subject'] = "Test";
$headers['Content-Type'] = "text/plain; charset=utf-8";
$recipients = '[email protected]';
$body = 'Something';