Skip to content

Instantly share code, notes, and snippets.

View six519's full-sized avatar

Ferdinand E. Silva six519

View GitHub Profile
@six519
six519 / gist:3634045
Created September 5, 2012 09:27
Split Words
<?php
function splitWords($paragraph, $numberOfWords) {
$returnArray = array();
$splittedString = explode(" ", $paragraph);
$counter = 0;
$counter2 = 0;
for($x = 0; $x < count($splittedString); $x++) {
@six519
six519 / gist:4965681
Last active December 13, 2015 19:49
Quote of the day shit!
"""
.. module:: qotd_shit
.. moduleauthor:: Ferdinand (The **Brain Damage**) Silva <ferdinandsilva@ferdinandsilva.com>
Just got bored again and played around with some few lines of code in Python
================================
List of operational QOTD Servers
================================
@six519
six519 / gist:5131794
Created March 11, 2013 03:54
Using python-simsimi
"""
Goto https://github.com/six519/python-simsimi
"""
from python_simsimi import SimSimi
from python_simsimi.language_codes import LC_FILIPINO
from python_simsimi.simsimi import SimSimiException
simSimi = SimSimi(
conversation_language=LC_FILIPINO,
conversation_key='<API KEY>'
@six519
six519 / gist:5958511
Created July 9, 2013 15:53
Reverse Binary (Spotify Puzzle in Java)
import java.util.*;
import java.lang.*;
class ReversedBinaryToDecimal {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
int decimalNumber;
@six519
six519 / gist:5958565
Created July 9, 2013 15:58
Reverse Binary (Spotify Puzzle in PHP)
#!/usr/bin/env php
<?php
$stdIn = fopen("php://stdin","r");
$lineInput = fgets($stdIn);
if($lineInput >= 1 && $lineInput <= 1000000000) {
echo bindec(strrev(decbin($lineInput))), "\n";
} else {
echo "Invalid input\n";
@six519
six519 / gist:5958606
Created July 9, 2013 16:02
Reverse Binary (Spotify Puzzle in Python)
#!/usr/bin/env python
if __name__ == "__main__":
decimalNumber = raw_input()
try:
decimalNumber = int(decimalNumber)
if decimalNumber >= 1 and decimalNumber <= 1000000000:
@six519
six519 / gist:5958661
Created July 9, 2013 16:06
ZipfSong (Spotify Puzzle)
#!/usr/bin/env python
"""
:) :) :) :)
"""
if __name__ == "__main__":
inputs = []
while 1:
@six519
six519 / gist:6155445
Created August 5, 2013 12:07
Talk To Elbot
"""
If you want to talk to Elbot!!!!!!
"""
import urllib
import urllib2
def talk_to_elbot(msg):
data = {
'IDENT':'J0YOjADZAb',
@six519
six519 / grab_gists.py
Created October 7, 2013 02:02
Grab GitHub Gist
#!/usr/bin/env python
"""
Install requests first
======================
* pip install requests
"""
import requests
gists = requests.get('https://api.github.com/users/six519/gists') #change six519 to your username
@six519
six519 / github_public_activity.py
Created October 21, 2013 10:39
Reading GitHub Public Activity using feedparser
"""
* Install feedparser first
pip install feedparser
"""
import feedparser
gitHubFeeds = feedparser.parse('https://github.com/six519.atom') #change six519 to your username
for entry in gitHubFeeds['entries']: