Skip to content

Instantly share code, notes, and snippets.

View amitavroy's full-sized avatar
🏠
Working from home

Amitav Roy amitavroy

🏠
Working from home
View GitHub Profile
@amitavroy
amitavroy / html_default
Last active December 18, 2015 22:59
This is my default html file as a starting point
<!doctype html>
<html lang="en" ng-app="anim">
<head>
<meta charset="UTF-8">
<title>Test page</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js"></script>
<script>
var anim = angular.module('anim', []);
anim.controller('MainCtrl', ['$scope', function ($scope) {
@amitavroy
amitavroy / gist:5748261
Created June 10, 2013 12:04
Adding odd even class
<div class="example-class<?php echo ($xyz++%2); ?>">
@amitavroy
amitavroy / gist:5748254
Created June 10, 2013 12:03
Get all tweets of a specific hashtag
function getTweets($hash_tag) {
$url = 'http://search.twitter.com/search.atom?q='.urlencode($hash_tag) ;
echo "<p>Connecting to <strong>$url</strong> ...</p>";
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$xml = curl_exec ($ch);
curl_close ($ch);
//If you want to see the response from Twitter, uncomment this next part out: