Bootstrap 4 Mixins | Compiled into |
---|---|
@include media-breakpoint-up(xs) | @media (min-width: 0px) |
@include media-breakpoint-up(sm) | @media (min-width: 576px) |
@include media-breakpoint-up(md) | @media (min-width: 768px) |
This file contains 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
javascript:function parseChatGPTData(data) { const mapping = data.mapping; const conversationTitle = data.title; const createDate = new Date(data.create_time * 1000).toISOString().slice(0, 10); const messagesArray = Object.values(mapping) .filter(node => node.message) .map(node => { const message = node.message; const sender = message.author.role === 'user' ? 'You' : 'Assistant'; const content = message.content.parts.join(''); const createTime = message.create_time; return { sender: sender, content: content, createTime: createTime, }; }); messagesArray.sort((a, b) => a.createTime - b.createTime); return { date: createDate, title: conversationTitle, messages: messagesArray.map(({ sender, content }) => ({ sender, content })), }; } function download(filename, text) { const element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); e |
This file contains 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
require 'prawn' | |
arr = HallSession | |
.joins(:check_in_sessions, :hall) | |
.group('check_in_sessions.hall_session_id, auditorium_halls.name, hall_sessions.start_at, hall_sessions.end_at, hall_sessions.id') | |
.select('auditorium_halls.name as hall_name, hall_sessions.start_at, hall_sessions.end_at, COUNT(*) as c') | |
.order('hall_name, start_at, end_at') | |
.map do |ci| | |
[ |
gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'
Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component
(and thus, prerendering).
Note that jquery-rails
can be removed from Gemfile, the npm version of jquery
and jquery-ujs
will be used instead.
This file contains 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
$states = [ | |
'JHR' => 'Johor', | |
'KDH' => 'Kedah', | |
'KTN' => 'Kelantan', | |
'MLK' => 'Melaka', | |
'NSN' => 'Negeri Sembilan', | |
'PHG' => 'Pahang', | |
'PRK' => 'Perak', | |
'PLS' => 'Perlis', | |
'PNG' => 'Pulau Pinang', |
This file contains 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
Model.where(:date_column => date) | |
Model.where('extract(year from date_column) = ?', desired_year) | |
Model.where('extract(month from date_column) = ?', desired_month) | |
Model.where('extract(day from date_column) = ?', desired_day_of_month) |
This file contains 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
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" | |
PROFILE="$HOME/.profile" | |
echo "Downloading git-completion..." | |
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
fi |