Skip to content

Instantly share code, notes, and snippets.

View R3V1Z3's full-sized avatar

R3V1Z3 R3V1Z3

  • Los Angeles, CA
View GitHub Profile
@Zirak
Zirak / gist:1761880
Created February 7, 2012 20:52
A parser for DnD dice rolls
//infix operator-precedence parser
//also supports a d operator - a dice roll
var parsePrecedence = (function () {
//we don't care about whitespace. well, most whitespace
var whitespace = {
' ' : true,
'\t' : true
};
@lamprosg
lamprosg / qtxml.cpp
Created March 20, 2012 10:11
Writing and reading XML files with Qt - qxmlstreamwriter and qxmlstreamreader provided classes
//Writing and reading XML files with Qt - qxmlstreamwriter and qxmlstreamreader supported classes
void MyXMLClass::SaveXMLFile()
{
QString filename = QFileDialog::getSaveFileName(this,
tr("Save Xml"), ".",
tr("Xml files (*.xml)"));
@bobspace
bobspace / css_colors.js
Last active December 9, 2024 21:20
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@takien
takien / youtubeID.js
Last active May 3, 2024 12:41
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@tleguern
tleguern / nethack_release.txt
Created December 18, 2012 16:13
Releases of NetHack and its predecessor Hack, with the date and a link to the annoucement, when I found them. Some timestamps might be wrong.
17-Dec-84 19:26:34 Hack 1.0
21-Jan-85 21:44:28 Hack 1.0.1
01-Apr-85 22:31:25 Hack 1.0.2
23-Jul-85 16:24:17 EDT Hack 1.0.3
28-Jul-87 NetHack 1.3d
15-Aug-87 NetHack 1.4f
03-Dec-87 Nethack 2.2a
09-Apr-88 18:45:41 GMT Nethack 2.3e
24-Jul-89 Nethack 3.0.0
03-Aug-89 Nethack 3.0.1 [Announcement][1]
@davidgomes
davidgomes / How to change Pantheon Terminal's color scheme.md
Created March 14, 2013 16:53
How to change Pantheon Terminal's color scheme

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an

@SammysHP
SammysHP / gist:5611986
Created May 20, 2013 12:41
Vim logo in ascii art
.
##############..... ##############
##############......##############
##########..........##########
##########........##########
##########.......##########
##########.....##########..
##########....##########.....
..##########..##########.........
....##########.#########.............
@markjaquith
markjaquith / gist:6225805
Last active September 5, 2024 01:41
WordPress multi-tenant directory structure sharing core files for opcode awesomeness, fast deployments, and low disk usage. With inspiration from @weskoop. "=>" indicates a symlink.
sites
|__ ms.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
| |__ wp-config.php
|__ one.dev
| |__ content
| |__ index.php
| |__ wp => ../../wordpress/stable
@mustafauysal
mustafauysal / fix-duplicated-posts.php
Created November 13, 2013 00:12
Bulk Fixing WordPress Duplicated Posts! Read for more information: http://uysalmustafa.com/2013/11/13/bulk-fixing-wordpress-duplicated-posts/
<?php
require( 'wp-load.php' );
//set_time_limit(30000); // you can set time limit, but I prefer to use command line > php fix-duplicated-posts.php
$query = "SELECT id,post_name, Count(*) FROM wp_posts WHERE post_type = 'post' GROUP BY post_name HAVING Count(*) > 1";
$duplicated_posts = $wpdb->get_results( $query );
foreach ( $duplicated_posts as $result ) {
$prepost = get_post($result->id);
$prepost->post_name = '';