Skip to content

Instantly share code, notes, and snippets.

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

(B3none) b3none

🍰
Ah, it's a piece of cake, so it is!
  • Blue Light Card
  • Derby, UK
View GitHub Profile
@a7madgamal
a7madgamal / dark.md
Last active Nov 17, 2020
Dark mode for Slack on MacOS
View dark.md
@b3none
b3none / StatusCodeHandler.php
Created Sep 6, 2017
HTTP Error handling class
View StatusCodeHandler.php
<?php
class StatusCodeHelper
{
const ERROR_CODES = [
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
@justbill2020
justbill2020 / readme.md
Created Dec 21, 2016
Delete All Messages in a channel on discord
View readme.md
;(function(){
	const authToken = JSON.parse(localStorage.token);
	const channel = window.location.href.split('/').pop();
	const baseURL = `https://discordapp.com/api/channels/${channel}/messages`;
	const headers = {"Authorization": authToken };

	let clock = 0;
        let interval = 500;
@ankurk91
ankurk91 / xdebug-mac.md
Last active Mar 5, 2021
php xDebug on Ubuntu/Mac and phpStorm
View xdebug-mac.md

🐞 Install and Configure xDebug on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active Feb 26, 2021
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

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
mandiwise / Count lines in Git repo
Last active Mar 4, 2021
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@timetocode
timetocode / twitch-widget.html
Created Sep 25, 2014
JavaScript Widget, displays if a twitch.tv user is currently streaming.
View twitch-widget.html
<!-- jQuery, delete this line if you already have jQuery on your page -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- the twitch widget, place code in the <HEAD> -->
<script>
var twitchUserName = 'timetocode' // your name goes here
$(document).ready(function() {
$.getJSON("https://api.twitch.tv/kraken/streams/"+twitchUserName+"?callback=?",function(streamData) {
console.log('Stream Data:', streamData) // debug message, shows all available data
if(streamData && streamData.stream) {
@julionc
julionc / 00.howto_install_phantomjs.md
Last active Feb 8, 2021
How to install PhantomJS on Debian/Ubuntu
View 00.howto_install_phantomjs.md

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
webdesserts / Gulpfile.js
Last active Dec 9, 2020
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/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,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@embray
embray / suggest_backports.py
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.
View suggest_backports.py
#!/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