Skip to content

Instantly share code, notes, and snippets.

View nicor88's full-sized avatar
:octocat:

nicor88 nicor88

:octocat:
  • Berlin, Germany
View GitHub Profile
@robertpainsi
robertpainsi / README.md
Last active April 16, 2025 14:39
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@DrewML
DrewML / Theming-Slack-OSX.md
Last active January 25, 2022 00:53
Theming Slack for OSX

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

How to (OSX Only)

@amatthies
amatthies / boto3_profiles.md
Last active September 25, 2018 02:26
Handling multiple aws profiles and roles on my local machine

Handling multiple aws profiles and roles on my local machine

I have pretty some aws profiles. And each of those profiles can assume pretty some IAM roles. I write code for instance roles: I trip, when I see aws_access_key_id = in code. ("No! No! No!")

When I started writing aws stuff, I added profile= arguments to all my boto3 constructors... until the roles started to be crucial. In fact, on several AWS accounts I can be several users, who can assume several roles.

Long story short: meanwhile, I handle all profile and (most of the) region stuff locally before coding, not in the code. For an EC2 instance, the needed credentials are "just there" – I want the same on my local machine.

My ~/.aws folder contains two files, credentials and config:

@arikfr
arikfr / README.md
Last active August 26, 2024 19:27
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
@kartben
kartben / mqtt_spark_streaming.py
Last active June 10, 2024 17:16
Example of how to use Spark Streaming for MQTT data consolidation
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@mengzhuo
mengzhuo / boyer_moore
Created March 6, 2015 16:05
Boyer Moore Demo in Python
#!/usr/bin/env python
# encoding: utf-8
"""
Boyer Moore Demo
Inspired by https://www.youtube.com/watch?v=PHXAOKQk2dw
Copyright (C) 2015 Meng Zhuo <[email protected]>
"""
def make_bad_match_table(pattern):
@obolton
obolton / elb-nodejs-ws.md
Last active November 12, 2023 11:49
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

@earth2marsh
earth2marsh / uber.yaml
Last active April 5, 2021 13:39
A Swagger YAML specification for Uber's new API
swagger: 2
info:
title: The new Uber API
description: Move your app forward with the Uber API
version: "1.0.0"
host: api.uber.com
schemes:
- https
basePath: /v1
produces:
@basham
basham / css-units-best-practices.md
Last active March 10, 2025 20:57
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 15, 2025 03:42
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k