This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import urllib.request | |
import time | |
import datetime | |
import subprocess | |
from html.parser import HTMLParser | |
from pprint import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch '{ nvidia-smi -q -d temperature | grep "GPU Current Temp"; sensors; }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, hmac, hashlib, time, requests, base64 | |
from requests.auth import AuthBase | |
class AbuCoins(AuthBase): | |
def __init__(self, api_key, secret_key, passphrase): | |
self.api_key = api_key | |
self.secret_key = secret_key | |
self.passphrase = passphrase | |
def __call__(self, request): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# git pre-commit hook that runs an clang-format stylecheck. | |
# Features: | |
# - abort commit when commit does not comply with the style guidelines | |
# - create a patch of the proposed style changes | |
# modifications for clang-format by rene.milk@wwu.de | |
# This file is part of a set of unofficial pre-commit hooks available | |
# at github. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <cstring> | |
template<class T, class UnaryPredicate> | |
void reverseStringExtra(T& text, const UnaryPredicate& predicate) | |
{ | |
auto previousPivot = std::begin(text); | |
auto pivot = previousPivot; | |
while ((pivot = std::find_if(pivot, std::end(text), predicate)) != std::end(text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentStatePagerAdapter; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
public class CyclicPagesAdapter extends FragmentStatePagerAdapter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import android.graphics.Bitmap.Config; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.graphics.Shader; | |
// enables hardware accelerated rounded corners | |
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
struct has_onEnter | |
{ | |
private: | |
template<typename U> | |
static auto test(int) -> decltype(std::declval<U>().onEnter(), std::true_type | |
{}); | |
template<typename > | |
static std::false_type test(...); |
NewerOlder