Skip to content

Instantly share code, notes, and snippets.

View datalifenyc's full-sized avatar

Chidi datalifenyc

View GitHub Profile
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@arukavina
arukavina / CHANGELOG.md
Created April 14, 2018 18:55
CHANGELOG.md example

Changelog

All notable changes to this project will be documented in this file.

[Unreleased]

[0.0.3] — 2014–08–09

Added

  • “Why should I care?” section mentioning The Changelog podcast.

[0.0.2] — 2014–07–10

@arukavina
arukavina / python_comments.py
Created April 14, 2018 18:53
Python Inner Comments
g = 'module attribute (module-global variable)'
"""This is g's docstring."""
class AClass:
c = 'class attribute'
"""This is AClass.c's docstring."""
def __init__(self):
"""Method __init__'s docstring."""
@arukavina
arukavina / header1b.py
Created April 14, 2018 18:37
Python Header Imports
# Futures
from __future__ import unicode_literals
from __future__ import print_function
# Generic/Built-in
import datetime
import argparse
# Other Libs
import youtube_dl
@arukavina
arukavina / header1.py
Last active June 29, 2023 00:15
Lazy C&P header
#!interpreter [optional-arg]
# -*- coding: utf-8 -*-
"""
{Description}
{License_info}
"""
# Futures
from __future__ import print_function
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 2, 2024 05:49
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@marcoagner
marcoagner / kill_process.py
Last active May 11, 2022 20:11
Python script to kill a process by its name
import os, signal
def check_kill_process(pstring):
for line in os.popen("ps ax | grep " + pstring + " | grep -v grep"):
fields = line.split()
pid = fields[0]
os.kill(int(pid), signal.SIGKILL)