Skip to content

Instantly share code, notes, and snippets.

@igniteflow
igniteflow / git_python_current_branch.py
Created February 7, 2012 17:33
GitPython get current active branch
"""
Gets the name of the active Git branch as a string.
Depends on GitPython
pip install GitPython
"""
from git import Repo
repo = Repo('/path/to/your/repo')
branch = repo.active_branch
@tautologico
tautologico / drivertest.cpp
Created June 6, 2012 02:58
Vector addition example using CUDA driver API
/*
* drivertest.cpp
* Vector addition (host code)
*
* Andrei de A. Formiga, 2012-06-04
*/
#include <stdio.h>
#include <stdlib.h>
@lisysolution
lisysolution / ps-basic.ps1
Last active January 30, 2023 14:23
파워쉘 - 기본 코드
# =====================================
# 초기 스크립트 실행 허용으로 설정하는 방법
# =====================================
Set-ExecutionPolicy RemoteSigned -Force
# =====================================
# 파라미터 지정 방법
# =====================================
# 소스의 최상단에 있어야 함
param (
@Brimizer
Brimizer / git_repo_info.py
Last active November 8, 2022 13:33 — forked from igniteflow/git_python_current_branch.py
GitPython get current active branch
"""
Depends on GitPython
pip install GitPython
"""
from git import Repo
def get_current_branch_name(repo_path)
"""
Gets the name of the active Git branch as a string.
@jiunsiew
jiunsiew / m10_vocab.csv
Last active January 24, 2018 12:14
Coursera Neural Networks – week 5 – embeddings visualisation with PCA in R
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
all
set
just
show
being
money
over
both
years
four
@alexaleluia12
alexaleluia12 / flask_logging_requests.py
Last active March 19, 2024 13:49
Flask Logging (every request)
#/usr/bin/python
# http://exploreflask.com/en/latest/views.html
# https://stackoverflow.com/questions/51691730/flask-middleware-for-specific-route
# https://dev.to/rhymes/logging-flask-requests-with-colors-and-structure--7g1
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime