Skip to content

Instantly share code, notes, and snippets.

View nothingatalldotnet's full-sized avatar
💭
it's coming it's real

RJ nothingatalldotnet

💭
it's coming it's real
View GitHub Profile
@nothingatalldotnet
nothingatalldotnet / now-playing.php
Created September 19, 2015 13:59
Simple Last.fm now playing
<?php
class NowPlaying{
private $url;
private $noTrackPlayingMessage;
function __construct($user, $api_key){
$this->url = 'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1';
$this->url .= '&user=' . $user . '&api_key=' . $api_key;
$this->noTrackPlayingMessage = 'nothing is playing right now!';
}
@nothingatalldotnet
nothingatalldotnet / get-twitter-feed.php
Created February 1, 2016 13:03
Simple get twitter feed...
<?php
require "social-feed-resources/twitteroauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
$twitter_customer_key = '_KEY_';
$twitter_customer_secret = '_SECRET_';
$twitter_access_token = '_ACCESS_';
$twitter_access_token_secret = '_SECRET_TOKEN';
$tweet_count = 10;
@nothingatalldotnet
nothingatalldotnet / mac-addhost.sh
Created April 1, 2016 10:17
Bash script to add a line to osx hosts file
#!/bin/sh
ETC_HOSTS=/etc/hosts
IP="xx.xx.xx.xx"
HOSTNAME="www.domain.com"
HOSTS_LINE="$IP\t$HOSTNAME"
if [ -n "$(grep $HOSTNAME /etc/hosts)" ]
then
@nothingatalldotnet
nothingatalldotnet / index.js
Created May 4, 2016 15:18
Cordova Android SharedPreferences / iOS KeyChain basic bits
var app = {
settings : {
device_platform : '',
storage_name : 'some-prefs'
},
initialize: function() {
this.bindEvents();
},

Keybase proof

I hereby claim:

  • I am nothingatalldotnet on github.
  • I am nothingatall (https://keybase.io/nothingatall) on keybase.
  • I have a public key whose fingerprint is 6B2A C537 8AD7 1BB1 3A43 9AED 4B26 1E28 123C 60B5

To claim this, I am signing this object:

@nothingatalldotnet
nothingatalldotnet / validator.js
Last active August 31, 2016 10:08
Simple universal form validator
validator: function(form) {
var valid_form = true,
password_array = [],
reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]).{16,}$/;
$(form+" *").filter(':input').each(function(){
switch ($(this).attr('type')) {
case 'text':
if($(this).val() !== "") {
if($.trim($(this).val()) === "") {