Skip to content

Instantly share code, notes, and snippets.

View six519's full-sized avatar

Ferdinand E. Silva six519

View GitHub Profile
@six519
six519 / qotd.rb
Created October 11, 2014 12:19
QOTD client in Ruby
#!/usr/bin/env ruby
=begin
(Just a Ruby programming language syntax review)
Converted my Python code here http://ferdinandsilva.com/code/4965681/ to Ruby code
=end
require 'socket'
QOTD_SERVER = "alpha.mike-r.com" #operational QOTD Server
begin
@six519
six519 / ass_to_srt.rb
Created October 14, 2014 05:21
ASS!!! (Advanced Sub Station Alpha) file converter to srt file
#!/usr/bin/env ruby
=begin
(Just a Ruby programming language syntax review again!!!)
ASS!!! (Advanced Sub Station Alpha) file converter to srt file
=end
def desc_to_tag(description, txt)
case
when description == "Bold"
@six519
six519 / grab_gists.rb
Created October 15, 2014 06:29
Grab GitHub Gist (Ruby)
#!/usr/bin/env ruby
=begin
(Ruby programming language syntax review again and again!!!!)
Converted my Python code here http://ferdinandsilva.com/code/6861541/ to Ruby code
=end
require "net/http"
require "json"
gist_uri = URI "https://api.github.com/users/six519/gists" #change six519 to your username
res = Net::HTTP.get_response gist_uri
@six519
six519 / pull_twitch_data.py
Created December 5, 2014 03:16
Get Twitch Most Popular Games And Streams
#!/usr/bin/env python
import requests
import sys
import json
POPULAR_GAMES_FILE = "twitch_popular.json"
POPULAR_GAMES_MAX_COUNT = 6
POPULAR_STREAM_PER_GAME = 5
def errorMessage(msg, errCode=-1):
@six519
six519 / install_gradle.sh
Created February 10, 2015 08:15
Install / Update Gradle Script (Tested In Fedora 20/CentOS 7)
#!/usr/bin/env bash
: '
Tested
======
Fedora 20
CentOS 7
What?
=====
@six519
six519 / pyyts_test.py
Created February 19, 2015 08:28
YTS Python API Client Usage (pyyts)
#!/usr/bin/env python
"""
Installing the API client
=========================
pip install pyyts
API client code can be viewed at
================================
@six519
six519 / test_hook.py
Last active September 13, 2021 01:05
Sending Bitbucket POST Hook To Slack Incoming Webhooks (Python Code)
#!/usr/bin/env python
"""
Python Module Depedencies:
==========================
falcon
requests
"""
import falcon
import json
import requests
@six519
six519 / JsonPost.vb
Created April 1, 2015 07:19
JSON HTTP POST Request In Visual Basic .NET
'Install Newtonsoft.json
'-----------------------
'
'PM> Install-Package Newtonsoft.Json -Version 6.0.8
'Sample Usage
'------------
'Dim jsonPost As New JsonPost("http://192.168.254.104:8000")
'Dim dictData As New Dictionary(Of String, Object)
@six519
six519 / JsonPost.cs
Created April 2, 2015 00:28
JSON HTTP POST Request In C# .NET
/*
What?
-----
C# version of http://ferdinandsilva.com/code/5ed917850f402b94ee6b/
Install Newtonsoft.json
-----------------------
PM> Install-Package Newtonsoft.Json -Version 6.0.8
@six519
six519 / EchoSMSReceiver.java
Created June 5, 2015 06:51
Echo SMS Receiver
/**
* Setup
* =====
*
* * Add permissions to manifest file
*
* 1) android.permission.RECEIVE_SMS
* 2) android.permission.SEND_SMS
*
* * Add receiver to manifest file