Skip to content

Instantly share code, notes, and snippets.

View darkvertex's full-sized avatar
👨‍🚀
Pipelines in spaaaaaaaaceeeee!!

Alan Fregtman darkvertex

👨‍🚀
Pipelines in spaaaaaaaaceeeee!!
  • Felix & Paul Studios
  • Montreal, Canada
  • 15:04 (UTC -04:00)
  • X @alanwritescode
View GitHub Profile
@gauravtiwari
gauravtiwari / window-auth-popup.es6.js
Last active April 12, 2024 00:56
Promise based popup window for server oAuth
/* global window */
const popup = (url) => {
const windowArea = {
width: Math.floor(window.outerWidth * 0.8),
height: Math.floor(window.outerHeight * 0.5),
};
if (windowArea.width < 1000) { windowArea.width = 1000; }
if (windowArea.height < 630) { windowArea.height = 630; }
@Ahuge
Ahuge / Example Signals Multithreaded.py
Last active November 5, 2020 05:57
Basic Example of using a pure python Signal/Slot implementation talking between threads. Aims to feel like Qt's Signals.
# ------------------------------------------------------------------------------------------------------------ #
# --------------------------------------------- Signal Library ----------------------------------------------- #
# ------------------------------------------------------------------------------------------------------------ #
import weakref
class Signal(object):
def __init__(self, *types):
self._call_types = types
self._connections = set()
@asith-w
asith-w / JavaScript oAuth Popup Window Handler Code.js
Created September 13, 2016 12:14
JavaScript oAuth Popup Window Handler Code
//Authorization popup window code
function ShowAuthWindow(options)
{
console.log('ee');
options.windowName = options.windowName || 'ConnectWithOAuth'; // should not include space for IE
options.windowOptions = options.windowOptions || 'location=0,status=0,width=800,height=400';
options.callback = options.callback || function(){ window.location.reload(); };
var that = this;
console.log(options.path);
that._oauthWindow = window.open(options.path, options.windowName, options.windowOptions);
from click import command, option, Option, UsageError
class MutuallyExclusiveOption(Option):
def __init__(self, *args, **kwargs):
self.mutually_exclusive = set(kwargs.pop('mutually_exclusive', []))
help = kwargs.get('help', '')
if self.mutually_exclusive:
ex_str = ', '.join(self.mutually_exclusive)
kwargs['help'] = help + (
@jackcarter
jackcarter / slack_delete.py
Last active November 29, 2023 07:03
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@lmarkus
lmarkus / README.MD
Last active March 27, 2024 07:15
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@n0531m
n0531m / list_gcp_iprange.sh
Last active April 17, 2024 21:50
Google Cloud Platform : ip address range
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#find_ip_range
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
myarray=()
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
myarray+=($LINE)
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :`
@nk9
nk9 / largestFiles.py
Last active November 14, 2023 09:47
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#
@Daniel15
Daniel15 / FaviconProgress.html
Last active November 9, 2023 21:33
Using Favicon as progress bar
<!DOCTYPE html>
<html>
<head>
<title>Example Page</title>
</head>
<body>
<p>This page uses the favicon as a progress bar. Try clicking the button.</p>
<button onclick="run()">Do something</button>
<script>
@lambdalisue
lambdalisue / qt_rounded_window.py
Last active March 24, 2022 04:20
An example code to make rounded window on Qt
# coding=utf-8
"""
"""
__author__ = 'Alisue <lambdalisue@hashnote.net>'
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
from PyQt4 import QtCore
from PyQt4 import QtGui