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 / 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 / oauth.js
Created October 15, 2017 09:42 — forked from srph/oauth.js
axios: interceptor which includes your oauth token in every request as an Authorization header
import axios from 'axios';
// You can use any cookie library or whatever
// library to access your client storage.
import cookie from 'cookie-machine';
axios.interceptors.request.use(function(config) {
const token = cookie.get(__TOKEN_KEY__);
if ( token != null ) {
config.headers.Authorization = `Bearer ${token}`;
@croogie
croogie / react-sortable.html
Last active December 30, 2015 15:45 — forked from petehunt/React sortable
Here's an example of React + jQuery UI sortable. The key thing to note is that we have the render() method do absolutely nothing and use componentDidUpdate() + React.renderComponent() to proxy updates through to the children. This lets us manage the DOM manually but still be able to use all the React goodies you know and love.
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://fb.me/react-0.5.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script>
</head>
@croogie
croogie / gist:2bf3389667f25d0f5140
Last active August 29, 2015 14:27 — forked from kmymtksh/gist:4087912
antigen random theme select one liner
$ antigen-theme `perl -MList::Util=shuffle -MFile::Basename -e 'print +$x = shuffle map { basename($_,".zsh-theme") } glob ".oh-my-zsh/themes/*zsh-theme"'`
@croogie
croogie / .gitignore
Last active August 29, 2015 14:18 — forked from mbostock/.block
.DS_Store
build
node_modules
@croogie
croogie / .gitignore
Created April 6, 2015 11:44 — forked from mbostock/.block
Map Pan & Zoom IV
.DS_Store
build
node_modules