Skip to content

Instantly share code, notes, and snippets.

@glinesbdev
glinesbdev / index.html
Created May 3, 2017 22:39
Longest word in string (immutable.js)
<!doctype html>
<html>
<head>
<title>Immutable</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/immutable/3.8.1/immutable.min.js"></script>
<script>
const lyrics = "Another dream that will never come true Just to compliment your sorrow Another life that I've taken from you A gift to add on to your pain and suffering Another truth you can never believe Has crippled you completely All the cries you're beginning to hear Trapped in your mind, and the sound is deafening Let me enlighten you This is the way I pray Living just isn't hard enough Burn me alive, inside Living my life's not hard enough Take everything away Another nightmare about to come true Will manifest tomorrow Another love that I've taken from you Lost in time, on the edge of suffering Another taste of the evil I breed Will level you completely Bring to life everything that you fear Live in the dark, and the world is threatening Let me enlighten you This is the way i pray Liv
@glinesbdev
glinesbdev / has_from_file.pl
Last active May 1, 2017 04:58
Create hash from file
#!/usr/bin/perl
use strict;
use warnings;
sub read_line {
our %hash;
my @list = split(" ", shift);
foreach my $word (@list) {
$hash{$word}++;
@glinesbdev
glinesbdev / create_hash.pl
Created May 1, 2017 04:30
Sub to create hash
#!/usr/bin/perl
use strict;
use warnings;
sub create_hash {
my %hash;
my @keys = "@{$_[0]}";
my @values = "@{$_[1]}";
foreach my $i (0 .. $#keys) {
@glinesbdev
glinesbdev / lyrics.pl
Created April 29, 2017 22:46
Unique words in lyrics
#!/usr/bin/perl
use strict;
use warnings;
my $lyric_file = $ARGV[0];
my @unique_words = [];
my $total_words = 0;
open(my $lyrics, '<:encoding(UTF-8)', $lyric_file)
or die "Could not open file '$lyric_file' $!";
@glinesbdev
glinesbdev / card.rb
Last active April 24, 2017 20:25 — forked from camkidman/card.rb
card = Card.first # as an example
card.card_set_id = CardSet.find_by(:name => card.set).id
card.save
# => ActiveRecord::RecordInvalid: Validation failed: Card set must exist
@glinesbdev
glinesbdev / Main.elm
Created April 22, 2017 05:52
Text to Html
module Main exposing (..)
import Html exposing (Html, text, img, div)
import Html.Attributes exposing (src)
sampleText : String
sampleText =
"Once during your turn (before you attack), you may turn all basic Energy attached to all of your Pokémon into Fire Energy for the rest of the turn. This power can't be used if Charizard is affected by a Special Condition."
@glinesbdev
glinesbdev / Main.elm
Created April 21, 2017 14:33 — forked from anonymous/Main.elm
Parse string and replace
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
sampleText : String
sampleText =
"As long as Rayquaza has any Grass Energy cards attached to it, ignore the effect of Rayquaza's Lightning Storm attack."
@glinesbdev
glinesbdev / Main.elm
Created April 21, 2017 14:33 — forked from anonymous/Main.elm
Untitled
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
sampleText : String
sampleText =
"As long as Rayquaza has any Grass Energy cards attached to it, ignore the effect of Rayquaza's Lightning Storm attack."
@glinesbdev
glinesbdev / index.html
Created October 4, 2016 19:23
Basic Bootstrap Nav Html
<header>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-1" aria-expanded="false">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@glinesbdev
glinesbdev / Nav.elm
Created October 4, 2016 02:28
Default Bootstrap Navbar in Elm
module Nav exposing (..)
import Html exposing (Html, div, a, span, i, ul, li, nav, button, text, form, input, header)
import Html.Attributes exposing (class, id, href, placeholder, attribute, type')
navbar : Html msg -> Html msg
navbar links =
header []
[ nav [ class "navbar navbar-default" ]