This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
red = '\033[0;31m' | |
cyan = '\033[0;36m' | |
no_color = '\033[0m' | |
def replace(pattern, string, replace='__'): | |
regextester(pattern, string, replace) | |
def vreplace(pattern, string, replace='__'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNextSequenceNumber($sequenceName) | |
{ | |
global $wpdb; | |
$wpdb->query($wpdb->prepare( | |
" | |
INSERT INTO table_name | |
(seq_name, seq_num) | |
VALUES (%s, LAST_INSERT_ID(1)) | |
ON DUPLICATE KEY UPDATE seq_num = LAST_INSERT_ID(seq_num + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://abc.com/#/contact | |
http://abc.com/#/contact?asdf=asdfr | |
http://abc.com/#/contact/?asdf=asdfr | |
http://abc.com/#/contact | |
http://abc.com/#/?sadfasd=asdf | |
http://abc.com/#/contact | |
/contact/? | |
/{required}/? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
import time | |
from collections import namedtuple | |
from statistics import stdev, mean | |
import hlt | |
from hlt import EAST, NORTH, SOUTH, STILL, WEST, Move, Square | |
# uses: | |
# https://github.com/erdman/alt-python3-halite-starter/blob/master/hlt.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env PYTHONIOENCODING=utf-8 python | |
# encoding: utf-8 | |
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS""" | |
from __future__ import absolute_import, print_function, unicode_literals | |
import os | |
import subprocess | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Better Twitter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove unwanted stuff (promoted, other people's likes, ...) | |
// @author Scott Carpenter | |
// @match https://twitter.com/ | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.githubusercontent.com/scarpent/ba8e369f1187fa990b98d1f58b2c013d/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js | |
// @grant none |