Skip to content

Instantly share code, notes, and snippets.

@kohheepeace
kohheepeace / memo.md
Last active April 27, 2024 06:28
Rails ajax comparison (fetch, Rails.ajax, axios, @rails/request.js, Turbo)

Rails ajax comparison (fetch, Rails.ajax, axios, @rails/request.js, Turbo)

I wrote this gist because I felt that the Rails documentation was lacking a description of ajax requests.

๐Ÿ“Œ Options for ajax request

There are various ways to send ajax requests in Rails.

  1. Browser default Fetch API
  2. Rails.ajax (No Official docs and request for docs)
  3. http client like axios
  4. @rails/request.js ๐Ÿ‘ˆ I'm using this one now !
@cirrusUK
cirrusUK / config
Created May 6, 2015 17:27
teiler config
##### teiler configuration file ######
# general variables
backend=rofi
slop_color="255,0,0"
slop_border=2
hidecursor=yes
# the path where images, videos and pastes should be saved
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@cirrusUK
cirrusUK / config
Created June 22, 2015 18:13
teiler configuration file
##### teiler configuration file ######
# general variables
backend=rofi
slop_color="255,0,0"
slop_border=2
hidecursor=yes
# the path where images, videos and pastes should be saved
@cirrusUK
cirrusUK / PlayMusic.settings (paste contents when asked to create settings file)
Last active April 27, 2024 06:27
shell script for downloading/streaming music from pre defined websites
#/usr/local/settings/PlayMusic.settings
mplayer #first line should be player
http://ccmixter.org/view/media/samples/mixed
http://ccmixter.org/view/media/remix
http://mp3.com/top-downloads/genre/jazz/
http://mp3.com/top-downloads/
http://mp3.com/top-downloads/genre/rock/
http://ccmixter.org/view/media/playlists
#-------- i think only downloads work with these sites, no streaming -----
http://www.last.fm/music/+free-music-downloads
@cirrusUK
cirrusUK / haxfoxglobal.css
Created October 8, 2015 19:26
firefox global css theme
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Browser Background */
browser[type="content-primary"] {
background-color: #141414 !important;
}
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(ftp://), url-prefix(file://) {
@cirrusUK
cirrusUK / arena.sh
Last active April 27, 2024 06:25
Simple dialouge box for choosing streams, requires sopcast-launcher, acestream-launcher, zenity & mpv
#! /bin/bash
#dialouge box for playing acestream streams, requires acestream launcher & mpv
action=$(zenity --window-icon "/usr/share/zenity/zenity.png" --list \
--column=" ๐Ÿ“บ Stream Listing ๐Ÿ“บ" --text=" ๐Ÿง Pick a stream: โฌโ†“๐Ÿ“บ๐Ÿ“บ๐Ÿ“บ๐Ÿ“บ๐Ÿ“บโ†“โฌ ๐Ÿง " \
"acetv" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44")
ret=$?
[[ $ret -eq 1 ]] && exit 0
case $action in
mpv 'https://www.youtube.com/playlist?list=PL7ykCJqlS3T4Z2L8Xxld2OqCZ07B4ntKZ'
mpv 'https://www.youtube.com/playlist?list=PL7ykCJqlS3T4dgZtfNE7dxDDA38G48tCD'
mpv 'https://www.youtube.com/playlist?list=PL7ykCJqlS3T6ZLFVh__IXwg4uACQk2-ax'
mpv 'https://www.youtube.com/playlist?list=PL7ykCJqlS3T4lolVT98aiTpI5VGJMvtf-'
@QWxleA
QWxleA / Readme.md
Last active April 27, 2024 06:24
Obsidian zotero template for use with "obsidian-zotero-integration" plugin

QWxlea's over-engineered zotero template

Faq

What are these %% begin id-pn2xitti%% and %% end id-pn2xitti %% and ^pn2xitti? These are the persistance-markers of the indivual highlights, and the reference-id to that highlight.

The markers are meant for the importer. It will skip all text within those markers, so they stay when updating a zotero-import. Removing a marked block does not work well, it will not be reimported. Don't know how to fix that. If you want to reimport a highlight-block, best is to change the highlight in zotero (for example change the color). This will update the id, and on the next import the new highlight will be imported.

The reference-id is used like this: [[@name-of-the-note#^pn2xitti]]

@cirrusUK
cirrusUK / soma
Created October 30, 2016 22:26
radio shell script
#!/bin/bash
red=`tput setaf 1`
tput setaf 1
echo '
| _)
_| _` | _` | | _ \
_| \__,_| \__,_| _| \___/
'