Skip to content

Instantly share code, notes, and snippets.

Roneesh roneesh

Block or report user

Report or block roneesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roneesh
roneesh / gist:310c39f82db09def89c1fd98e4364e40
Created Mar 7, 2017
An example of properly formatted code
View gist:310c39f82db09def89c1fd98e4364e40
function underToCamel(underName) {
var camelCaseOutput = "";
var foundunder = false;
for( var i = 0; i < undername.length; i++) {
// undername[i];
if (undername[i] === "_") {
foundunder = true;
} else {
if (foundunder) {
camelcaseoutput += undername[i].toUpperCase();
@roneesh
roneesh / gist:ba629414e6fedc1abf95885d43211a1f
Created Mar 3, 2017
Drake Poem Generator Using Markov Chains
View gist:ba629414e6fedc1abf95885d43211a1f
function parseText(text) {
return text.split(' ').map(function(currentValue, index, array) {
return currentValue.toLowerCase().replace(/[.,']/g,"");
});
}
function generateWordPairs(text) {
var parsedText = parseText(text);
var wordPairs = {};
View keybase.md

Keybase proof

I hereby claim:

  • I am roneesh on github.
  • I am roneesh (https://keybase.io/roneesh) on keybase.
  • I have a public key whose fingerprint is 0436 6BBB BE9B F757 01D5 59EE DD53 4D11 3B5E 8261

To claim this, I am signing this object:

@roneesh
roneesh / gist:7be487be02d58ff16399
Created Feb 5, 2016
Several crackle pop solutions
View gist:7be487be02d58ff16399
// an uncommon implementation that creates a 100 character string, and replaces each character with either it's index or the crackle/pop/cracklepop
var s = (new Array(102).join('x')).replace(/x/g, function(match, index) {
return (index % 15 === 0 ? 'CracklePop\n' : (index % 5 === 0 ? 'Pop\n' : (index % 3 === 0 ? 'Crackle\n' : (index + '\n'))));
});
console.log(s);
// an uncommon implementation that uses an array and it's shifting to traverse the array
var numbers = Object.keys(new String(new Array(102)));
numbers.shift();
while (numbers.length) {
@roneesh
roneesh / gist:64ecd0bae69ec0efc8a2
Last active Aug 29, 2015
A clojure multi-if macro
View gist:64ecd0bae69ec0efc8a2
; first try
; broke because the macro ended up evaluating the condition and just being an instruciton to do the pass or fail
;(defmacro multi-if [test pass fail] (list 'if test (do pass) (do fail)))
; second try including arity and notice the returning of a construction
;(defmacro multi-if [test & {then :then else :else}] (list 'if test (cons 'do then) (cons 'do else)))
; third try, seems to have proper way of supplying map to macro as argument
;(defmacro multi-if [test & {:keys [then else]}] (list 'if test (cons 'do then) (cons 'do else)))
@roneesh
roneesh / gist:a082c84e09c4a0c47c46
Last active May 26, 2016
Front-end framework using object.observe! (just the JS)
View gist:a082c84e09c4a0c47c46
var person = {
name: 'Dude!',
age: '100',
profession :'Welder'
},
hook = document.getElementById('hookOne');
function render(location, object) {
location.innerHTML = '';
var newBio = document.createElement('div');
@roneesh
roneesh / gist:1d64cc9009281790496d
Last active Aug 29, 2015
Object.observe trial
View gist:1d64cc9009281790496d
<html>
<head>
<style>
.hook {
width: 200px;
height: 200px;
background-color: rgba(0,0,0, 0.5);
border-radius: 15px;
color: white;
@roneesh
roneesh / gist:92505c7c763b6db2f758
Created Aug 18, 2014
This gist is an example of a text box having faded out text rather than an overflow scroll bar
View gist:92505c7c763b6db2f758
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" href="http://brick.a.ssl.fastly.net/Latin+Modern+Roman:400">
<style>
p { font-size: 22px; font-family: 'Latin Modern Roman'; width: 100%;}
div { margin: 0; margin-left: 100px;}
.text-box {
width: 415px;
@roneesh
roneesh / gist:7254605
Created Oct 31, 2013
This is my first line of thinking. I have had all the individual social class sub-class from SocialData, and each one only has four methods, initialize, symbolize, shares, and response, which is protected in each. This idea came about because I wanted to escaped_url to be a single method definition across all the sub-classes (DRY). Currently the…
View gist:7254605
require 'typhoeus'
require 'uri'
class SocialData
attr_accessor :url
def initialize(url)
self.url = url
end
View gist:6141355
<script type="text/javascript" src="http://i0.poll.fm/survey.js" charset="UTF-8"></script>
<noscript><a href="http://polldaddy.com/s/how-do-you-like-new-home-tours">Take Our Survey!</a></noscript>
<script type="text/javascript">
polldaddy.add( {
type: 'button',
title: 'Take Our Survey!',
style: 'inline',
id: '8EF3172A8164D399'
} );
</script>
You can’t perform that action at this time.