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
| class ParseTarget(object): | |
| TYPES = frozenset(('tire', 'disc', 'oil', 'acc', 'additional',)) | |
| def __init__(self): | |
| self.current_tag = None | |
| self.current_type = None | |
| self._depth = 0 |
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
| # https://rvm.io/packages/openssl/ - look | |
| sudo apt-get install openssl # do i need this? | |
| rvm pkg install openssl | |
| rvm reinstall all --force |
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
| sudo apt-get install libsqlite3-dev | |
| gem install sqlite3 -v '1.3.7' |
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
| filetype off | |
| call pathogen#runtime_append_all_bundles() | |
| " making CommandT work... | |
| map <C-t> :CommandT<CR> | |
| syntax enable | |
| set background=light | |
| set t_Co=16 | |
| let g:solarized_termcolors=16 | |
| colorscheme solarized |
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/perl | |
| # | |
| $text = <>; | |
| @links = $text =~ m/href=\"([^\"]+)/g; | |
| print join ("\n", @links), "\n"; |
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
| create_big_data_from_csv_dir <- function(directory, ids) { | |
| # locate the files | |
| files <- list.files(directory, full.names=T)[ids] | |
| # read the files into a list of data.frames | |
| data.list <- lapply(files, read.csv) | |
| # concatenate into one big data.frame | |
| data.cat <- do.call(rbind, data.list) | |
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
| fibonacci :: Integer -> Integer | |
| fibonacci 0 = 0 | |
| fibonacci 1 = 1 | |
| fibonacci n = fibohelper n 1 0 | |
| fibohelper 1 acc1 acc2 = acc1 | |
| fibohelper c acc1 acc2 = fibohelper (c - 1) (acc1 + acc2) acc1 |
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
| {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, FlexibleContexts #-} | |
| import Geom2D | |
| left :: (Num a) => Point a -> a -> Point a | |
| left (Point x y) n = Point (x - n) y | |
| right :: (Num a) => Point a -> a -> Point a | |
| right (Point x y) n = Point (x + n) y | |
| up :: (Num a) => Point a -> a -> Point a |
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
| {-# LANGUAGE OverloadedStrings, ExistentialQuantification, ExtendedDefaultRules, FlexibleContexts, Rank2Types, TemplateHaskell #-} | |
| module Demo where | |
| import Data.Monoid ((<>)) | |
| import Lens.Micro.Platform | |
| data ExampleParams = ExampleParams | |
| { _foo :: Int | |
| , _bar :: [Int] | |
| } deriving (Show) |
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 | |
| import sys | |
| import sqlite3 | |
| import sqlparse | |
| from PyQt5.QtWidgets import * | |
| from PyQt5.QtCore import QAbstractTableModel, Qt | |
| class SQLite3TableModel(QAbstractTableModel): | |
| def __init__(self, db, queriesText, *argv, **kwargs): |