Skip to content

Instantly share code, notes, and snippets.

View nealrs's full-sized avatar
💭
code monster

Neal Shyam nealrs

💭
code monster
View GitHub Profile
@nealrs
nealrs / gist:1a4804a0b00c95b5dcb8
Last active August 29, 2015 14:01
g@m Jr. demo
# Say hello to Jr.
This is a demo of [David Pennington](https://github.com/Xeoncross)'s client-side [static site generator](https://github.com/Xeoncross/jr).
The whole page is regular markdown (except for the `jr.js` load)
*For basic bloggers & the CMS averse, this may be just want you need.*
<script src="js/jr.js"></script>
@nealrs
nealrs / gist:2ad91bd4fbb8c830b972
Created October 26, 2014 16:56
fix non-looping gifs
# fix non-looping gifs
#source: http://superuser.com/questions/159212/how-do-i-make-an-existing-animated-gif-loop-repeatedly
./gifsicle -bl /path/to/image.gif
@nealrs
nealrs / demo i62.py
Last active August 29, 2015 14:09
Toga demo for issue 62 of Git@Me
# Giphy API search written with Toga -- written for Issue 62 of Git@Me
# This is entirely cribbed from the Toga Browser tutorial. This isn't a particuarly good demo, but it'll do. @nealrs 2014
#!/usr/bin/env python
from __future__ import print_function, unicode_literals, absolute_import
import urllib
import json
import toga
@nealrs
nealrs / ys.zsh-theme
Created February 9, 2015 14:19
my edits to the ys theme for oh-my-zsh
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 ys
# Machine name.
function box_name {
@nealrs
nealrs / 5_28_15.md
Created May 28, 2015 15:06
great CP projects
  • Created by a team Led by Todd Semple, ceator of Plants vs. Zombies
  • VR Puzzle Game using GearVR
  • excellent blackless color pallette inspired by impressionist exhibit at the deYoung museum in SF
  • ride a magic carpet, collect items, avoid danger, get lost
  • looking up to the sky lets you access inventory / navigate / other tasks - pretty innovative!
  • created for Oculus VR Jam
@nealrs
nealrs / convert.md
Created September 21, 2015 17:24
Convert XML data to JSON in Python

I recommend using the xml2json python package to convert back and forth from XML/JSON.

  1. Install it with pip: pip install xml2json

  2. Convert a file: xml2json -t xml2json -o output.json input.xml --strip_text

The output JSON won't be pretty printed (as in the attached file, but it will be valid!!)

@nealrs
nealrs / demo.html
Created September 30, 2015 20:23
Devpost Hackathon Button
<html>
<body>
<a href target="_blank" class="devpostButton" data-slug="artik" data-begin="2014-09-27 10:00 EST" data-deadline="2014-10-01 10:00 EST" data-defcss="true" >Submit your hack on Devpost</a>
<script src="devpostButton.js"></script>
</body>
</html>
@nealrs
nealrs / p0.txt
Created October 8, 2015 03:11
create animation with Rayito & ImageMagick
# (optional, default 320 240) size = size of the final image
size 1024 768
nbounces 5
# (optional, default 1) oversampling=1 no oversampling
oversampling 2
# (optional, default 60) vision = size of the visual field
vision 60
@nealrs
nealrs / index.js
Created October 23, 2015 21:17
Devpost -> image
var request = require('request');
var handlebars = require('handlebars');
var project = 'distractedness';
var url = 'http://devpost.com/software/' + project;
var api = 'https://iii3mdppm7.execute-api.us-east-1.amazonaws.com/prod/ProjectEndpoint/' + project;
var source = "<h2>{{title}}</h2><p>{{tagline}}</p><ul>{{#collaborators}}<li> <img src='{{avatar_url}}'> {{name}}</li>{{/collaborators}}</ul><ul>{{#built_with}}<li> #{{name}}</li>{{/built_with}}</ul>";
request({url: api, json: true}, function(err, res, json) {
if (err) {throw err;}
@nealrs
nealrs / zd.py
Created November 19, 2015 15:36
delete ziggeo videos
from Ziggeo import Ziggeo
ziggeo = Ziggeo("APP_TOKEN", "PRIVATE_KEY", "ENC_KEY")
print ziggeo.videos().delete("VIDEO_TOKEN")