Skip to content

Instantly share code, notes, and snippets.

View croogie's full-sized avatar

Michał Świtoń croogie

View GitHub Profile
@croogie
croogie / gist:75ede7415320ce30a831031b89d85a1c
Created April 22, 2021 06:42 — forked from ionvv/gist:5749c2105459c47d8fe527f953dd3924
BitBar plugin - Crypto stats (CoinGecko API)
#!/usr/local/bin/node
/*
* <bitbar.title>Elrond Stats</bitbar.title>
* <bitbar.version>v1.0</bitbar.version>
* <bitbar.author>Ion Vrinceanu</bitbar.author>
* <bitbar.author.github>ionvv</bitbar.author.github>
* <bitbar.desc>Elrond stats</bitbar.desc>
* <bitbar.dependencies>node</bitbar.dependencies>
*/
@croogie
croogie / slackapi-async-await.js
Created March 9, 2021 08:04 — forked from girliemac/slackapi-async-await.js
Examples of calling Slack Web API method via HTTP with axios
const axios = require('axios');
const qs = require('qs');
const apiUrl = 'https://slack.com/api';
const greet = () => {
let messageArgs = {
token: process.env.SLACK_ACCESS_TOKEN,
channel: '#cats',
text: ':wave: Hello, welcome to the channel!',
@croogie
croogie / .zshrc
Created October 28, 2020 07:17 — forked from matthewmccullough/.zshrc
A configuration to maintain history across sessions and share it across terminals in ZShell
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
@croogie
croogie / utils.js
Created June 25, 2020 05:28
JIRA ticket info
const YAML = require('yaml');
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const axios = require('axios');
const { get } = require('lodash');
const getUnreleasedFilesList = (changelogDir = '.') => {
const changelogEntriesPath = path.join(changelogDir, 'unreleased');
const changelogFiles = glob.sync(path.join(changelogEntriesPath, '*.yml'));
@croogie
croogie / init.lua
Created May 21, 2020 10:03
HammerSpoon configuration file
local CTRL = "⌃"
local ALT = "⌥"
local CMD = "⌘"
local SHIFT = "⇧"
local all = {CTRL, ALT, CMD}
local right_2 = {ALT, CMD}
local left_2 = {CTRL, ALT}
local split = {CTRL, CMD}
local hyper = {CMD, ALT, CTRL, SHIFT}
@croogie
croogie / handler.ts
Created March 20, 2020 16:00
Serverless TS example
import { Handler, Context, Callback } from 'aws-lambda';
interface HelloReponse {
statusCode: number;
body: string;
}
const hello: Handler = (event: any, context: Context, callback: Callback) => {
const response: HelloReponse = {
statusCode: 200,
@croogie
croogie / index.js
Created August 26, 2019 22:02 — forked from adam-cowley/index.js
Neo4j Driver as an Express Middleware
// Create an express app
const express = require('express');
const app = express();
// Tell it to use Neo4j middleware
app.use(require('./neo4j'));
// Example Route
app.get('/', (req, res) => {
// Create Driver session
@croogie
croogie / download.js
Created September 13, 2018 17:28 — forked from gregbarcza/download.js
Download all image from cloudinary
'use strict'
const cloudinary = require('cloudinary')
const Promise = require('bluebird')
const co = require('co')
const fs = Promise.promisifyAll(require('fs'))
const request = require('request')
const moment = require('moment')
// FILL THIS
cloudinary.config({
cloud_name: '',
@croogie
croogie / js
Created July 1, 2018 17:52
Dodawanie wyjątków do AdBlocka
abp:subscribe?location=http%3A%2F%2F3.fwcdn.pl%2Fadv%2Ffilmweb.pl.txt&title=filmweb.pl
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'