This file contains 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
# will highlight the term you are grepping for, works in bash and zsh | |
alias grep='GREP_COLOR="1;37;41" LANG=C grep --color=auto' |
This file contains 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
(* written by @chrisamaphone of chrisamaphone fame *) | |
val s_end = "\nval s_start = \"val s_end = \"\nfun quote #\"\\n\" = \"\\\\n\"\n\t| quote #\"\\\\\" = \"\\\\\\\\\"\n\t| quote c = Char.toString c\n\nfun q () = print (s_start ^ \"\\\"\" ^ (concat (map quote (explode s_end))) ^ \"\\\"\" ^ s_end)" | |
val s_start = "val s_end = " | |
fun quote #"\n" = "\\n" | |
| quote #"\\" = "\\\\" | |
| quote c = Char.toString c | |
fun q () = print (s_start ^ "\"" ^ (concat (map quote (explode s_end))) ^ "\"" ^ s_end) |
This file contains 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 ruby | |
# == Synopsis | |
# jsonpretty: a quick script for making JSON output legible | |
# | |
# == Usage | |
# jsonpretty [a JSON encoded file] | |
# [some stream with JSON text] | jsonpretty | |
# | |
# For this help use: jsonpretty -h |
This file contains 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
#include <iostream> | |
using namespace std; | |
int * Merge (int a[], int size_a, int b[], int size_b); | |
int main() { | |
int a[] = {1, 5, 8, 9, 13}; | |
int b[] = {2, 6}; | |
int * c = Merge(a, 5, b, 2); |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <iostream> | |
using namespace std; | |
char * remove_char_from_string(char *input_string, char given_char) { | |
char * newstring = (char *) calloc(strlen(input_string) + 1, sizeof(char)); |
This file contains 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
/** | |
* written by Dannel Jurado | |
* version: 03052009 | |
* | |
* changelog 03052009: Welcome screen behavior, instead of just welcome screen | |
* changelog 03032009: submitted version | |
*/ | |
#include <iostream> | |
#include <iomanip> |
This file contains 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/perl | |
use Shell qw(hostname date uptime users echo zwrite); | |
use Term::ANSIColor qw(:constants); | |
my $hostname = hostname; | |
chomp($hostname); # remove newline inserted by system command | |
@usersa = split(/\s/, users); # split users into an array | |
my $lncount = 80; # so the first line prints proper ^_^U | |
my $up = substr(uptime, 10); # display server uptime (the timestamp is a bit redudant I guess) | |
my $time = date; # remember where you're at in time |
This file contains 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
_ _ _______ __ _______ _______ ______ ______ ___ ______ __ | |
| | | | ____\ \ / / | ____\ \ / / ____| _ \ \ / / __ ) / _ \| _ \ \ / / | |
| |_| | _| \ V / | _| \ \ / /| _| | |_) \ V /| _ \| | | | | | \ V / | |
| _ | |___ | | | |___ \ V / | |___| _ < | | | |_) | |_| | |_| || |_ | |
|_| |_|_____| |_| |_____| \_/ |_____|_| \_\|_| |____/ \___/|____/ |_( ) | |
|/ | |
__ _____ _ _ ____ ____ _ _______ __ | |
\ \ / / _ \| | | | / ___| _ \ / \ |__ /\ \ / / | |
\ V / | | | | | | | | | |_) | / _ \ / / \ V / | |
| || |_| | |_| | | |___| _ < / ___ \ / /_ | | |
This file contains 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/php | |
<?php | |
/** | |
* lineColor | |
* mostly for use with DeMarko's color extension of IRCCat | |
* | |
* @arg line string representing MTA Subway line | |
* @return string representing MTA Subway line color | |
*/ | |
function lineColor($line) { |
This file contains 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 ruby | |
#--------------------------------- | |
# Yahoo weather app using YQL/JSON | |
#--------------------------------- | |
# based off of https://www.tropo.com/docs/scripting/t_ruby-yahooweather.htm | |
require 'rubygems' | |
require 'open-uri' | |
require 'json' | |
#Set the URI and our YQL select statement, then encode as a URI |
OlderNewer