Skip to content

Instantly share code, notes, and snippets.

View djrobby's full-sized avatar

Robby Dhillon djrobby

  • Detroit, MI - USA
View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active April 30, 2025 20:39
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mdang
mdang / RAILS_CHEATSHEET.md
Last active April 28, 2025 21:24
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@libraplanet
libraplanet / transcode to Icecast2 from RTMP using ffmpeg and systemd.
Last active March 23, 2021 12:26
transcode to Icecast2 from RTMP using ffmpeg and systemd.
[put transcode script]
PATH:/root/transcode/transcode.sh
[register and start service.]
PATH:/etc/systemd/system/transcode.radio.service
# systemctl enable transcode.service
# systemctl start transcode.service
@AlexAvlonitis
AlexAvlonitis / cryptoknight.rb
Last active March 31, 2021 20:45
Encrypt files with Ruby and OpenSSL
# Ruby script encrypts files with OpenSSL
# https://github.com/alexavlonitis
i = 1
while i != 0 do
puts "---MENU---"
puts "(1) to Encrypt"
puts "(2) to Decrypt"
puts "(3) to Exit"
print ": "
@dpaluy
dpaluy / pipelined_example.rb
Last active May 23, 2020 15:58
Pipeling Multiple REDIS Commands in Ruby
Pipeliner.pipeline redis do |pipe|
objects.each do |object|
pipe.enqueue redis.hgetall(object.key) do |result|
object.values = result
end
end
end
@dstagner
dstagner / gist:193207fed46acf5b5bae
Last active October 10, 2024 11:50
Ruby ISO8601 time in milliseconds

So you want to generate ISO8601 formatted timestamps in Ruby, but need resolution finer than a second?

First, make sure to require 'time' in order to get ISO8601 formatting. But that gets you this:

2.1.0 :001 > require 'time'
 => true 
2.1.0 :002 > Time.now.utc.iso8601
 => "2015-11-12T04:46:43Z" 
@J2TEAM
J2TEAM / sublime-text-scopes.md
Last active January 17, 2024 22:44 — forked from iambibhas/scopes.txt
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@odigity
odigity / sequel_scopes.rb
Last active April 19, 2024 14:13
The Sequel Gem: Everything About Scopes
# (I recommend understanding the basics of this first: http://sequel.jeremyevans.net/rdoc/files/doc/object_model_rdoc.html)
# Extending the underlying dataset (http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html#label-Extending+the+underlying+dataset)
# The recommended way to implement table-wide logic by defining methods on the dataset using dataset_module:
class Post < Sequel::Model
dataset_module do
def posts_with_few_comments
where{num_comments < 30}
@tysonmote
tysonmote / keys.rb
Last active January 2, 2019 23:18
Utility functions for performing operations on large Redis keyspaces
require 'redis'
REDIS = Redis.new( url: "..." )
def each_keys_chunk( pattern = nil, &block )
opts = { count: 100 }
opts[:match] = pattern if pattern
cursor = 0
loop do
cursor, keys = REDIS.scan( cursor, opts )
@wesbos
wesbos / settings.json
Created July 21, 2015 13:46
Wes Bos' Sublime Text Settings
{
"added_words":
[
"Mockup",
"plugins",
"coffeescript",
"sourcemaps",
"html",
"plugin",
"init",