Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

t k tahia-khan

🌴
On vacation
Block or report user

Report or block tahia-khan

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
@itod
itod / split_keyboards.md
Last active Oct 8, 2019
Every "split" mechanical keyboard currently being sold that I know of
View split_keyboards.md
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created Jun 16, 2016
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
View ansible-bootstrap-ubuntu-16.04.yml
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
View permutations.py
from collections import deque
def permutations(word):
if len(word) == 1:
return [word]
perms = permutations(word[1:])
c = word[0]
res = []
View qsort.py
def qsort(A, L, U):
if L < U:
P = A[L]
W = L
for i in range(L, U):
if A[i] < P:
W += 1
tmp = A[i]
A[i] = A[W]
A[W] = tmp
@viper233
viper233 / ansible_api_playbook.py
Created Feb 26, 2016
Example using Ansible API 2.0 to run a playbook
View ansible_api_playbook.py
#!/usr/bin/env python
# stolen from http://stackoverflow.com/questions/27590039/running-ansible-playbook-using-python-api
import os
import sys
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
@vasanthk
vasanthk / System Design.md
Last active Oct 13, 2019
System Design Cheatsheet
View System Design.md

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active Sep 27, 2019
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@willprice
willprice / .travis.yml
Last active Oct 14, 2019
How to set up TravisCI for projects that push back to github
View .travis.yml
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active Oct 1, 2019
Setting up Vim as your Go IDE
View gist:74e7635275331d5afa6b

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@miguelmota
miguelmota / README.md
Last active Oct 7, 2019
Multiple accounts with Mutt E-Mail Client (gmail example)
View README.md

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
You can’t perform that action at this time.