Skip to content

Instantly share code, notes, and snippets.

View Yevgnen's full-sized avatar
🔥

Yevgnen Yevgnen

🔥
View GitHub Profile
@Arkanosis
Arkanosis / properties.cpp
Last active May 14, 2023 17:36
Python style properties in C++
/*
** Python style properties in C++
** (C) 2010 Arkanosis
** jroquet@arkanosis.net
**
** Example code released under the MIT license
** http://www.opensource.org/licenses/mit-license.php
**
** This is an original portable version of
** http://www.codeproject.com/KB/cpp/properties.aspx
@bobthecow
bobthecow / tab.bash
Last active November 10, 2023 08:47
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
@akheron
akheron / remote-emacs.sh
Created March 2, 2011 11:28
Use emacsclient for editing remote files by setting this script as EDITOR in the remote machine
#!/bin/sh
#
# Use this script as your EDITOR to allow editing remote files with emacsclient.
# Works by connecting to the Emacs machine with SSH and using a suitable tramp prefix.
# How to reach this machine from the one that's running Emacs
ME=user@remote-host
# How to reach the machine that's running Emacs from this machine
THEY=user@host-running-emacs
@drj42
drj42 / org-mode-reference-in.org
Created February 6, 2012 23:53
This is a cheat sheet for Emacs org-mode... in org-mode format!
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@timofurrer
timofurrer / gist:2725779
Created May 18, 2012 15:11
C++ convert string to every type using template function
template <typename T>
T ConvertString( const std::string &data )
{
if( !data.empty( ))
{
T ret;
std::istringstream iss( data );
if( data.find( "0x" ) != std::string::npos )
{
iss >> std::hex >> ret;
@jborden
jborden / javac-mode.el
Created June 22, 2012 16:13
A minor mode for compiling and running java from emacs
;; Minor mode for compiling java classes
(defvar javac-mode nil
"Mode variable for java class files.")
(make-variable-buffer-local 'javac-mode)
(defun javac-mode (&optional arg)
"Minor mode for compiling java class files.
Special Commands:
\\{javac-mode-map}"
(interactive "P")
@filsinger
filsinger / main.cpp
Created October 18, 2012 09:06
C++11 : Split a string using regex
#include <regex>
#include <string>
#include <vector>
std::vector<std::string> Split(const std::string& str, const std::string& regex)
{
return {std::sregex_token_iterator(str.begin(), str.end(), std::regex(regex), -1), std::sregex_token_iterator()};
}
@techtonik
techtonik / find_executable.py
Last active April 4, 2022 06:23
Python Which/Where - Find executable
#!/usr/bin/env python
# https://gist.github.com/4368898
# Public domain code by anatoly techtonik <techtonik@gmail.com>
# AKA Linux `which` and Windows `where`
# For Python 3 you probably want
# https://docs.python.org/dev/library/shutil.html#shutil.which
import os
@abhinav-upadhyay
abhinav-upadhyay / DateTimeDecoder.py
Last active July 4, 2023 13:12
A JSON decoder/encoder implementation for parsing dates as datetime objects in Python
#!/usr/bin/env python
# An example of decoding/encoding datetime values in JSON data in Python.
# Code adapted from: http://broadcast.oreilly.com/2009/05/pymotw-json.html
# Copyright (c) 2023, Abhinav Upadhyay
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: