This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.
- Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
| #!/usr/bin/env python2 | |
| import sqlite3 | |
| import os | |
| import sys | |
| import webbrowser as wb | |
| import urllib2 | |
| for path in ( | |
| os.path.expanduser('~/.config/google-chrome/'), | |
| os.path.expanduser('~/.config/chromium/'), |
| #include <iostream> | |
| #include <fstream> | |
| #include <vector> | |
| #include <climits> | |
| #include <exception> | |
| #include <set> | |
| using namespace std; | |
| struct Edge { |
| from django.core.exceptions import MiddlewareNotUsed | |
| from django.conf import settings | |
| import cProfile | |
| import pstats | |
| import marshal | |
| from cStringIO import StringIO | |
| class ProfileMiddleware(object): | |
| def __init__(self): | |
| if not settings.DEBUG: |
| #!/usr/bin/sudo sh | |
| ## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+. | |
| ## From `strings ruby_concealer.so`: | |
| ## | |
| ## > This obfuscation is intended to discourage GitHub Enterprise customers | |
| ## > from making modifications to the VM. | |
| ## | |
| ## Well, good, as long as its not intended to discourage *me* from doing this! |
| #!/usr/bin/env node | |
| /** | |
| * Capture or replay responses from an HTTP server. | |
| */ | |
| var sys = require('sys'), | |
| path = require('path'), | |
| args = process.argv.slice(2), |
| /** | |
| C++ Producer Consumer using C++11 thread facilities | |
| To compile: g++ -std=c++11 <program name> -pthread -lpthread -o pc | |
| */ | |
| #include <iostream> | |
| #include <sstream> | |
| #include <vector> | |
| #include <stack> | |
| #include <thread> | |
| #include <mutex> |
| <?php | |
| namespace Drupal\acme\Controller; | |
| use Drupal\Core\Controller\ControllerBase; | |
| class DefaultController extends ControllerBase | |
| { | |
| /** |
| #!/usr/bin/env ruby | |
| require "webrick" | |
| =begin | |
| WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby. | |
| It comes with most installations of Ruby by default (it’s part of the standard library), | |
| so you can usually create a basic web/HTTP server with only several lines of code. | |
| The following code creates a generic WEBrick server on the local machine on port 1234, |
| # Ways to execute a shell script in Ruby | |
| # Example Script - Joseph Pecoraro | |
| cmd = "echo 'hi'" # Sample string that can be used | |
| # 1. Kernel#` - commonly called backticks - `cmd` | |
| # This is like many other languages, including bash, PHP, and Perl | |
| # Synchronous (blocking) | |
| # Returns the output of the shell command | |
| # Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |