Skip to content

Instantly share code, notes, and snippets.

View dareosK's full-sized avatar
🎯
Focusing

Dareos Khalili dareosK

🎯
Focusing
View GitHub Profile

Fixing Webpacker 3.3.0 + Rails 5.1.5

Heroku hosting trouble

Heroku may not detect a correct buildpack for your JS dependencies, then you have to set it manually:

heroku buildpacks:add heroku/nodejs -i 1
heroku buildpacks:add --index 2 https://github.com/heroku/heroku-buildpack-ruby
@eneko
eneko / list-of-curl-options.txt
Last active July 22, 2024 16:16
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@a-barbieri
a-barbieri / videos_helper.rb
Last active July 6, 2023 08:21
Rails helper to embed YouTube and Vimeo iframe in view
# Helpers for better embedding and manipulation of videos
# Place this code in app/helpers/videos_helper.rb
# Then from any view you can add:
#
# <%= get_video_iframe('http://the.video.url') %>
#
# Optionally you can add width and height.
#
# <%= get_video_iframe('http://the.video.url', '1600px', '900px') %>
#
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
## Sonic Pi triplets example
## http://sonic-pi.net
live_loop :triplets do
density 3 do
play :e4, release: 0.1
sleep 1
end
end
@nicooga
nicooga / game_of_life.rb
Last active October 14, 2021 11:04
Ruby gosu implementation of Cpnway's game of life
require 'gosu'
ANIMATION_INTERVAL = 0.4
module GameOfLife
class Cell
attr_accessor :x, :y
def initialize(hash)
raise 'Bad attribute keys' unless (hash.keys - [:x, :y, :alive]).empty?
@bartholomej
bartholomej / css-media-queries-cheat-sheet.css
Last active July 23, 2024 12:17
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@stevenyap
stevenyap / Simple Form.md
Created October 26, 2013 04:25
Simple Form Cheatsheet

Gemfile

gem 'simple_form'

Installation

rails generate simple_form:install