Skip to content

Instantly share code, notes, and snippets.

Ah, it's a piece of cake, so it is!

(B3none) b3none

Ah, it's a piece of cake, so it is!
View GitHub Profile
a7madgamal /
Last active Oct 20, 2021
Dark mode for Slack on MacOS
b3none / StatusCodeHandler.php
Created Sep 6, 2017
HTTP Error handling class
View StatusCodeHandler.php
class StatusCodeHelper
const ERROR_CODES = [
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
justbill2020 /
Created Dec 21, 2016
Delete All Messages in a channel on discord
	const authToken = JSON.parse(localStorage.token);
	const channel = window.location.href.split('/').pop();
	const baseURL = `${channel}/messages`;
	const headers = {"Authorization": authToken };

	let clock = 0;
        let interval = 500;
ankurk91 /
Last active Jun 30, 2022
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update
pecl clear-cache

pecl install xdebug
renshuki /
Last active Aug 13, 2022
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

mandiwise / Count lines in Git repo
Last active Sep 22, 2022
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference:
$ git ls-files | xargs wc -l
timetocode / twitch-widget.html
Created Sep 25, 2014
JavaScript Widget, displays if a user is currently streaming.
View twitch-widget.html
<!-- jQuery, delete this line if you already have jQuery on your page -->
<script src=""></script>
<!-- the twitch widget, place code in the <HEAD> -->
var twitchUserName = 'timetocode' // your name goes here
$(document).ready(function() {
$.getJSON(""+twitchUserName+"?callback=?",function(streamData) {
console.log('Stream Data:', streamData) // debug message, shows all available data
if(streamData && {
julionc /
Last active Sep 28, 2022
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
webdesserts / Gulpfile.js
Last active Mar 6, 2022
Automatically reload your node.js app on file change with Gulp (
View Gulpfile.js
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
embray /
Last active Jul 26, 2019
List pull requests merged since the last tag on the given release branch which have not yet been merged into the release branch.
#!/usr/bin/env python
# I wasn't happy with any of the GitHub libraries for Python that I tried so I
# just used the GitHub API directly. If someone would like to rewrite this
# using a library please be my guest
from __future__ import unicode_literals
import argparse
import base64