Skip to content

Instantly share code, notes, and snippets.

View trendsetter37's full-sized avatar

Javis Sullivan trendsetter37

View GitHub Profile
@trendsetter37
trendsetter37 / cVim
Last active December 11, 2017 16:47
Colemak friendly config
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
@trendsetter37
trendsetter37 / Keybase.md
Created November 21, 2017 23:26
Keybase proof

Keybase proof

I hereby claim:

  • I am trendsetter37 on github.
  • I am javis (https://keybase.io/javis) on keybase.
  • I have a public key ASCA-Ulx7uEbKzHJYFPdKP9396aRAwSxfAPPMvc4e5iYZgo

To claim this, I am signing this object:

@trendsetter37
trendsetter37 / main.rs
Created January 29, 2017 17:50
HackerEarth Input for Rust
use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input)
.expect("Failed to read line.");
let test_cases: u16 = input
.trim() // trim new line char
@trendsetter37
trendsetter37 / myIP.coffee
Created October 2, 2015 18:53
Getting Client IP in CoffeeScript
http.get { host: 'checkip.dyndns.org' }, (res) ->
data = ''
res.on 'data', (chunk) ->
data += chunk.toString()
res.on 'end', () ->
console.log data.match(/([0-9]+\.){3}[0-9]+/)[0]
@trendsetter37
trendsetter37 / team.py
Created April 24, 2015 14:43
ACM ICPC 2014 Team
def check_match2(person1, person2):
return bin(int('0b'+person1,2) | int('0b'+person2,2)).count('1')
def make_combos2(people):
plist = []; plist.append(input())
count = 0
maximum = 0
for i in range(people-1):
person = input()
@trendsetter37
trendsetter37 / pass_triangle.cpp
Created January 2, 2015 19:28
Pass Triangle on Codeeval
//Help came from Steven A. Dunn's code
#include <fstream>
#include <iostream>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
@trendsetter37
trendsetter37 / reverse_and_add.php
Last active August 29, 2015 14:11
Kind of a hack for the CodeEval reverse and add problem in php
<?php
/** Recursive calls should be kept to under 100 per problem prompt.
* Or else this would not work in PHP */
function iter_palindrome($integer, $count = 0) {
$reverse_int = strrev($integer);
if (intval($reverse_int) == intval($integer)) {
echo $count . " ";
(defun fib (n)
(labels ((calc-fib (n a b)
(if (= n 0)
a
(calc-fib (- n 1) b (+ a b)))))
(calc-fib n 0 1)))
(time (print (fib 7000)))
@trendsetter37
trendsetter37 / space_split.lisp
Created December 12, 2014 22:18
Common Lisp string splitting
(defun space-split (string)
"Parses integer strings right now but can be easily altered for
other purposes "
(loop for start = 0 then (1+ finish)
for finish = (position #\Space string :start start)
collecting (parse-integer (subseq string start finish))
until (null finish)))
@trendsetter37
trendsetter37 / first_nrc.cpp
Last active August 29, 2015 14:11
First Non-repeated Character (CodeEval)
/* First Non-repeated Character Moderate Challenge on CodeEval */
/* Comiple this with the -std=c++11 flag to prevent warnings */
#include <iostream>
#include <fstream>
#include <string>
#include <map>
struct Double
{
int val[2]; // { count, order }