Skip to content

Instantly share code, notes, and snippets.

@allansideas
allansideas / fontsquirrel-rails.rb
Created March 27, 2012 00:35
Little util for extracting fontsquirrel fontpacks renaming url( to font_url( for scss, and creating a fonts.css.scss file with all style rules. Put zips and script in vendor fonts, run, and copy fonts.css.scss to stylesheets dir and include in applicatio
#!/usr/bin/env ruby
#Extracts files to current dir, substitutes url( for font_url( and appends stylesheet to fonts.css.scss
completed_files = Array.new
current_directory = Dir.getwd
File.open('fonts.css.scss', "w") {}
Dir.foreach(current_directory) do |file_name|
if (file_name.include?(".zip") && !completed_files.include?(file_name))
system("unzip -o #{file_name}")
completed_files << file_name
style = File.read('stylesheet.css')
@allansideas
allansideas / plans.ex
Last active February 27, 2017 09:54
Marios Pyramid
defmodule Pyramid.Plans do
defstruct height: nil, layers: nil
end
defmodule Pyramid.Plans do
defstruct height: nil, layers: nil
end
@allansideas
allansideas / Union.elm
Created July 6, 2017 15:52
Trying to figure out why unions aren't working...
module Main exposing (..)
import Html exposing (Html, text, div, img)
import Html.Attributes exposing (src)
---- MODEL ----
type alias Model =
@allansideas
allansideas / UnionType Mixed Lists
Last active July 7, 2017 20:15
Trying to filter lists with mixed union types?
module Main exposing (..)
import Html exposing (Html, text, div, img)
import Html.Attributes exposing (src)
---- MODEL ----
type alias Model =
@allansideas
allansideas / UnionTypePlayground.elm
Last active July 8, 2017 13:48
Union type lists, and data structure help from elm slack for diffing purposes (Thanks @gilbert, and jordan.wilcken)
module Main exposing (..)
import Html exposing (Html, text, div, img)
---- MODEL ----
type alias Transition =
{ transitionType : String, toStoryNode : Int, text : Maybe String }
@allansideas
allansideas / Msg.elm
Created July 9, 2017 09:08
Circular dependency troubles
module Msg exposing (..)
import Types exposing (StoryNode, Transition)
type Msg
= NoOp
| Start
| TestStory
| NewStoryNode StoryNode
@allansideas
allansideas / History|-1085025c|entries.json
Last active August 15, 2023 11:49
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///home/digi/code/rails/planpolitik2021/db/migrate/20220408080932_add_name_and_description_to_download.rb","entries":[{"id":"V9jg.rb","timestamp":1649405430550},{"id":"E6A8.rb","source":"renamed.source","timestamp":1649405506500}]}