Skip to content

Instantly share code, notes, and snippets.

Jake Sylvestre jakesyl

Block or report user

Report or block jakesyl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gubatron
gubatron / CMakeList.txt
Last active Jan 22, 2020
CMakeList.txt for Bitcoin Unlimited + macOS CLion IDE based development
View CMakeList.txt
#
# Author: Angel Leon (@gubatron)
# October 2nd 2018
#
#
# README:
#
# This CmakeLists.txt file is not meant to produce any executables or libraries.
#
# It has been created for CLion or any other cmake compatible IDE users so that they can
@kantoniak
kantoniak / chrono-unixtimestamp.cpp
Created Apr 13, 2017
std::chrono example - getting unix timestamp
View chrono-unixtimestamp.cpp
#include <chrono>
#include <ctime>
#include <iostream>
int main() {
// std::chrono only
auto now = std::chrono::system_clock::now();
std::cout << "std::chrono only: " << std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count() << std::endl;
@fenbf
fenbf / sfinae_tostring_ex.cpp
Created Feb 9, 2016
C++ SFINAE example: how to detect if a class contains ToString method
View sfinae_tostring_ex.cpp
// SFINAE, enable_if example
// based on http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence
#include <iostream>
#include <type_traits>
class ClassWithToString
{
public:
@myusuf3
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@balupton
balupton / README.md
Created Jul 3, 2013
Android Emulator
View README.md

Android Emulator

  1. Download Android Studio
  2. Create a virtual device: /Applications/Android\ Studio.app/sdk/tools/android create avd -n <name> -t 1
  3. List your virtual devices: /Applications/Android\ Studio.app/sdk/tools/android list avd
  4. Run your virtual device: /Applications/Android\ Studio.app/sdk/tools/emulator -avd basic
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012
Git, Compression, and Deltas - An explanation
View git-compressing-and-deltas.md

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

You can’t perform that action at this time.