Skip to content

Instantly share code, notes, and snippets.

View brgnepal's full-sized avatar

Budh Ram Gurung (BRG) brgnepal

View GitHub Profile
@ordinaryzelig
ordinaryzelig / minitest_spec_expectations.md
Last active March 23, 2025 21:22
How to write MiniTest::Spec expectations

I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").

Understanding MiniTest::Expectations

Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):

# minitest/spec.rb

module MiniTest::Expectations
@jonforums
jonforums / download.rb
Created March 26, 2012 01:15
Ruby HTTP/HTTPS/FTP file downloader
#!/usr/bin/env ruby
# An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's
# HTTP implementation.
#
# Author: Jon Maken
# License: 3-clause BSD
# Revision: 2012-03-25 23:01:19 -0600
require 'net/http'
require 'net/https' if RUBY_VERSION < '1.9'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 16, 2025 22:55
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@alimd
alimd / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | ๐Ÿ˜„ | ๐Ÿ˜† | ๐Ÿ˜Š | ๐Ÿ˜ƒ | โ˜บ๏ธ | ๐Ÿ˜ | ๐Ÿ˜ | ๐Ÿ˜˜ | :kissing_face: | ๐Ÿ˜ณ | ๐Ÿ˜Œ | ๐Ÿ˜† | ๐Ÿ˜ | ๐Ÿ˜‰ | :wink2: | ๐Ÿ‘… | ๐Ÿ˜’ | ๐Ÿ˜… | ๐Ÿ˜“

๐Ÿ˜ฉ | ๐Ÿ˜” | ๐Ÿ˜ž | ๐Ÿ˜– | ๐Ÿ˜จ | ๐Ÿ˜ฐ | ๐Ÿ˜ฃ | ๐Ÿ˜ข | ๐Ÿ˜ญ | ๐Ÿ˜‚ | ๐Ÿ˜ฒ | ๐Ÿ˜ฑ | :neckbeard: | ๐Ÿ˜ซ | ๐Ÿ˜  | ๐Ÿ˜ก | ๐Ÿ˜ค | ๐Ÿ˜ช | ๐Ÿ˜‹ | ๐Ÿ˜ท

๐Ÿ˜Ž | ๐Ÿ˜ต | ๐Ÿ‘ฟ | ๐Ÿ˜ˆ | ๐Ÿ˜ | ๐Ÿ˜ถ | ๐Ÿ˜‡ | ๐Ÿ‘ฝ | ๐Ÿ’› | ๐Ÿ’™ | ๐Ÿ’œ | โค๏ธ | ๐Ÿ’š | ๐Ÿ’” | ๐Ÿ’“ | ๐Ÿ’— | ๐Ÿ’• | ๐Ÿ’ž | ๐Ÿ’˜ | โœจ

@andelf
andelf / sendMail.go
Last active March 21, 2025 03:36
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"

This is a note on storing encrypted data in Rails

@rxaviers
rxaviers / gist:7360908
Last active May 18, 2025 06:30
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@christopheranderton
christopheranderton / homebrew-github-api-token.md
Last active August 15, 2024 15:19
Set your Github API Token If you hit a โ€GitHub API rate limit exceededโ€ when searching with Homebrew (http://brew.sh/).

Description

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS
When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS

@basham
basham / css-units-best-practices.md
Last active March 10, 2025 20:57
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@roachhd
roachhd / README.md
Last active May 15, 2025 12:18
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„