Skip to content

Instantly share code, notes, and snippets.

View aniketpant's full-sized avatar
WHAT

Aniket Pant aniketpant

WHAT
View GitHub Profile
@jakerella
jakerella / alexa.md
Last active March 11, 2023 15:41
Speaking bio and abstracts for submission to conferences, user groups, etc.

Alexa, build me an app

Building an Amazon Echo (Alexa) skill is extremely simple, if a bit cumbersome. If you're not familiar, the Echo is an always-on home automation unit with built-in support for things like playing streaming music, getting weather information, and even turning on your wifi-connected lights. Amazon also allows developers to extend the Echo's functionality with custom "skills". These skills get the benefit of Amazon's full speech analysis engine and works through a simple JSON web API. In this talk we'll cover how we can use Node.js to write a simple skill and what else we need to do to get up and running. You'll learn how to test your new skill with a real voice interface and the basics of the cumbersome setup process on Amazon's developer portal along with some best practices. You don't need to own an Echo to write a skill... although they sure are fun to play with!

300 Characters

Building an Amazon Echo (Alexa) skill is extremely simple, if a bit cumbersome. Skills get the benef

@JAStanton
JAStanton / Google IO 2013 Binary Easter Egg
Last active December 14, 2015 14:59
goto https://developers.google.com/events/io/ and use these codes to get into secret easter egg locations of Google IO.
space: 00101010
pong: 10000001
simone: 11010011
eightbit: 01010011
song: 11011011
synth: 10001000
ascii: 01111111
bowling: 01110101
rocket: 01000101
burger: 00111001
@sanjayginde
sanjayginde / file_size_validation.jqtools.js
Last active December 11, 2015 17:29
JavaScript file size validation for HTML 5, using jQuery Tools validation and Parsley validation. (Additionally, extended modernizer for HTML5 File API.). The 'data-filemaxsize' attribute should be set in megabytes.
/**
* File size validation using jQuery Tools Validation (http://jquerytools.org/documentation/validator/index.html)
*/
if (Modernizr.fileapi) {
$.tools.validator.fn('input[type="file"][data-filemaxsize]', function($file_input, value) {
var files = $file_input.get(0).files,
max_megabytes = parseInt($file_input.data('filemaxsize')),
max_bytes = max_megabytes * BYTES_PER_MEGABYTE;
if (files.length > 0 && files[0].size > max_bytes) {
@surjikal
surjikal / postgres-cheat-sheet.md
Last active December 9, 2015 21:58
Postgres cheat sheet.

Default port: 5432

To log in (as root)...
psql -d template1 -U postgres

Commands

The prompt should be: template1=#

@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@lox
lox / simpletest-to-phpunit.php
Created December 3, 2012 19:12
A script for converting a test from SimpleTest to PHPUnit
#!/usr/bin/env php
<?php
/**
* Convert SimpleTest tests to PHPUnit, mocks to Mockery.
*
* Caveats:
* - Assertion + return value can't be combined automatically
*/
@klange
klange / _.md
Last active December 23, 2024 14:40
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@pathikrit
pathikrit / sudoku-1.coffee
Created October 10, 2012 07:04
1-liner CoffeeScript Sudoku Solver
solve = (s, c = 0) -> if c is 81 then s else if s[x = c/9|0][y = c%9] isnt 0 then solve s, c+1 else (([1..9].filter (g) -> ![0...9].some (i) -> g in [s[x][i], s[i][y], s[3*(x/3|0) + i/3|0][3*(y/3|0) + i%3]]).some (g) -> s[x][y] = g; solve s, c+1) or s[x][y] = 0
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active November 25, 2024 14:56
Using Git with Subversion Mirroring for WordPress Plugin Development
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@