Skip to content

Instantly share code, notes, and snippets.

View saginadir's full-sized avatar
:octocat:

Sagi saginadir

:octocat:
View GitHub Profile
@saginadir
saginadir / cpp_consoleLog.cpp
Created August 13, 2017 07:53
Always wanted the JavaScript console.log function in cpp? well now you have it:
void consoleLogHelper() {};
template <typename T>
void print(T t) {
std::cout << t << " ";
}
template <typename T, typename...Ts>
void consoleLogHelper(T &&first, Ts&&... rest) {
// print it
@kievechua
kievechua / propose.js
Last active February 8, 2017 06:55
ES6 Reverse Module - ES6 Module is a little hard to scan, can we put module in front instead?
/* Just create out of frustration, it's hard for me to scan through the line to add an item.
For example I want to add react-bootstrap component "Alert".
It's easier to use the proposed version to scan through and add in.
Also it can be sorted, if not multi line.
Might need to some thinking on the syntax. */
// Current
import { Breadcrumb } from 'components';
import connectData from 'helpers/connectData';
import {
@dbrockman
dbrockman / degrees-radians.h
Created February 12, 2013 21:52
Convert degrees <-> radians C macros
// Converts degrees to radians.
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0)
// Converts radians to degrees.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI)