Skip to content

Instantly share code, notes, and snippets.

View balthazar's full-sized avatar
🐦
Semantically satiated

balthazar

🐦
Semantically satiated
  • undefined
View GitHub Profile
#!/usr/bin/python
# -*- coding: mac_roman -*-
import android
import sha
from datetime import date
from optparse import OptionParser
droid = android.Android()
#ssid = droid.dialogGetInput('BBOX id', 'Entrer la BBOX id').result
// Utilitary script to get stats on all collections and indexes of a mongo cluster
//
// Usage:
// cat dbstats.js | mongosh MONGO_URI | sed -n 's/^>>:*//p'
// curl -L https://gist.githubusercontent.com/balthazar/e2047bdc23cd077ed7c91310f44552f0/raw | mongosh MONGO_URI | sed -n 's/^>>:*//p'
const mgo = db.getMongo()
const byteUnits = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
const RED = '\033[0;31m'
import q from 'q'
import passport from 'passport'
import { Strategy } from 'passport-github'
import Github from 'github'
passport.use(
new Strategy({ clientID: CLIENT_ID, clientSecret: CLIENT_SECRET },
async (req, accessToken, refreshToken, profile, done) => {
const github = new Github({ version: '3.0.0' })
github.authenticate({ type: 'token', token: accessToken })
console.log(stars.filter(s => s.user.starredRepositories.totalCount > 1).length)
const dates = stars.map(o => new Date(o.starredAt))
const grouped = _.groupBy(dates, d => format(d, 'YYYY/MM/DD'))
const byDay = Object.keys(grouped).reduce((acc, date, i) => {
const count = grouped[date].length
return acc.concat({ date, stars: count, total: i === 0 ? count : count + acc[i - 1].total })
}, [])
#!/bin/sh
curl 'https://www.random.org/lists/?mode=advanced' \
--data 'list=frappe%0D%0Ahighcharts%0D%0Arecharts%0D%0Afusion%0D%0Avictory%0D%0Acharts.js%0D%0Areact-vis%0D%0A&format=plain' --data 'list=react-vis%0D%0Areact-vis&format=plain' \
--compressed -s \
| sed -n 1p
{
"data": {
"repository": {
"stargazers": {
"pageInfo": {
"endCursor": "Y3Vyc29yOnYyOpIAzgHKebU=",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "Y3Vyc29yOnYyOpIAzgHKcDU="
},
{
repository(owner: "freeCodeCamp", name: "freeCodeCamp") {
stargazers(first: 50) {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
stars: edges {

Keybase proof

I hereby claim:

  • I am balthazar on github.
  • I am balthazar (https://keybase.io/balthazar) on keybase.
  • I have a public key ASCMFvpYCvG6rBKVuk0igHCEi5Ej7Mdw9pQ3lbIsI7_BZwo

To claim this, I am signing this object:

@balthazar
balthazar / yolo.js
Last active November 1, 2017 21:15
__KEYCODE__
efefef