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
use std::io; | |
fn main() { | |
// Readline, make sure that the line is not bad, raise error otherwise | |
let input = io::stdin().read_line().ok().expect("Failed to read line"); | |
// Take the input as a string slice, rather than a String | |
let input_slice: &str = input.as_slice(); 4 | |
// Get words in a vector, call reverse on it, returning an iterator, |
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
// eazyE is a simple syrup for error checking. It is a pattern I use often enough, | |
// so I decided to make a quick library out of it. | |
package eazyE | |
import ( | |
"fmt" | |
"log" | |
) | |
func New(s string, err error) (fErr error) { |
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
replace(searchstring,r"\w(?=\?)|(\w)$",'?')) | |
search(r"(?<=\().*?(?=\))", title) | |
search("(?=, ).*(?<=(is:))",locationstring) | |
match(Regex("(\\w*.?\\s){$numofwords}"),title) |
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
#define NIM_INTBITS 64 | |
#include "nimbase.h" | |
#include <string.h> | |
#include <stdio.h> | |
typedef struct response182008 response182008; | |
typedef struct NimStringDesc NimStringDesc; | |
typedef struct TGenericSeq TGenericSeq; | |
typedef struct stringtableobj145012 stringtableobj145012; |
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
(require :drakma) | |
(require :cl-ppcre) | |
(defvar *weather-url* "http://forecast.weather.gov/MapClick.php?zoneid=NYZ075&TextType=1" | |
"The url we'll be going to, to get the weather information") | |
(defun starts-with (regexp string) | |
"Checks to see if a string starts | |
with the given regexp" | |
(eq (search regexp string) 0)) |
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
import httpclient | |
import strutils | |
import re | |
var resp = get(url = "http://forecast.weather.gov/MapClick.php?zoneid=NYZ075&TextType=1") | |
var text = resp.body | |
for line in splitlines(text): | |
if line[0..2] == "<b>" or line[0..7] == "</table>": | |
echo(line.replace(re"\<.*?>"), "\n") |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type myStruct struct { | |
Field1 string | |
Field2 string |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
set shell=/bin/bash | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
set incsearch | |
"set list | |
"set listchars=tab:>. |
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
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> | |
PREFIX dbpprop: <http://dbpedia.org/property/> | |
PREFIX dbres: <http://dbpedia.org/resource/> | |
SELECT ?x WHERE { | |
?x a yago:Company108058098. | |
} | |
limit 100 |
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
# This shows a bit of shell muscle power | |
# First, we call find with maxdepth 1. This will make it so that find | |
# only searches within this current directory | |
# Then we use -type f to make sure find is only getting files | |
# then we use \! -name 'config.json'. | |
# Together, these flags mean that we will get only | |
# files (not directories, etc.) that are not named `config.json` | |
# in this directory. | |
# Thanks to Ike Levy for helping me figure out this badassery |
OlderNewer