Skip to content

Instantly share code, notes, and snippets.

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 27, 2024 06:31
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@cirrusUK
cirrusUK / adnnp
Last active April 27, 2024 06:30
shell scripts for posting to app.net/twitter current playing MPD track requires texapp and ttytter, i use em as cronjobs.
#!/bin/bash
msg=$(mpc current -h 192.168.1.33)
/home/cirrus/texapp.pl -status="#MPD Server nowplaying $msg. http://cirrus.turtil.net:9001"
exit
#!/bin/sh
URL="http://feeds.bbci.co.uk/news/uk/rss.xml"
curl --silent "$URL" | grep -E '(title>|description>)' | \
grep -E '(<title>|description)' | tail -n +4 | sed -e 's/<!\[CDATA\[//g' -e 's/\]\]>//g' | sed -e 's/<a.*a>/ /g' | sed -e 's/<*.title>//g' -e 's/&lt;.*/\
/' | sed -e 's/<*.title>//g' -e 's/&lt;.*/\
/' | sed -e '/<description>/d' | sed -e 's/<\/description>/\
/g
' | fmt -w 80
@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