Skip to content

Instantly share code, notes, and snippets.

View calzoneman's full-sized avatar

Calvin Montgomery calzoneman

View GitHub Profile
@calzoneman
calzoneman / termimg.c
Created January 13, 2018 07:54
Display images (in true color!) in a compatible terminal emulator using block characters
#include <gd.h>
#include <stdio.h>
#include <string.h>
void process(gdImagePtr img) {
for (int j = 0; j < img->sy/2; j++) {
for (int i = 0; i < img->sx; i++) {
int top = gdImageGetPixel(img, i, j*2 );
int bottom = gdImageGetPixel(img, i, j*2 + 1);
#!/bin/bash
npm install npm@3
deplist=`node -e 'p=require("./package");d=[];for(var n in p.dependencies)d.push(n+"@"+p.dependencies[n]);for(var n in p.devDependencies)d.push(n+"@"+p.devDependencies[n]);console.log(d.join(" "))'`
for dep in $deplist; do
echo "installing $dep"
./node_modules/npm/bin/npm-cli.js install $dep
done
./node_modules/npm/bin/npm-cli.js dedupe
./node_modules/npm/bin/npm-cli.js run postinstall
ip name
101.255.51.114 ALstNiEBQXki
101.255.51.114 BIGXvKEfqggr
101.255.51.114 ChYZoPGFegeQ
101.255.51.114 DBUTDQitdhUg
101.255.51.114 FmBKfPFmqsIf
101.255.51.114 FtAgxGZhJVrI
101.255.51.114 HQdFkLHnqrAS
101.255.51.114 KGsNrEbNQVov
101.255.51.114 mDXfCKhgkhOr
[100, 10, 5, 1].sort() // -> [1, 10, 100, 5]
parseInt(0.0000007) // -> 7
parseInt('0.0000007') === parseInt('1e-7'); // -> false
[1, 2, 3, 4, 5].map(parseInt) // -> [1, NaN, NaN, NaN, NaN]
x = null
typeof x === 'object' // -> true
@calzoneman
calzoneman / linux-flight-rules.md
Last active February 8, 2019 06:09
Miscellaneous solutions/reminders to problems I've encountered more than once

pip [for Python 3.2] throws UnicodeDecodeError on Debian Wheezy

Solution: export LANG=en_US.UTF-8

OpenVPN installation instructions

https://wiki.debian.org/OpenVPN

make-ovpn

@calzoneman
calzoneman / youtube.py
Last active December 2, 2015 10:16
YouTube module for willie - using v3 API
# coding=utf8
"""
youtube.py - Willie YouTube v3 Module
Copyright (c) 2015 Calvin Montgomery, All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list

Keybase proof

I hereby claim:

  • I am calzoneman on github.
  • I am montgc (https://keybase.io/montgc) on keybase.
  • I have a public key whose fingerprint is 71CC 8C03 9ED7 0A9C 1E4F EC8A 1957 FBB9 7ABF 6D2C

To claim this, I am signing this object: