Skip to content

Instantly share code, notes, and snippets.

View abhishekbhalani's full-sized avatar
🎄
working on latest framework...

Abhishek B. abhishekbhalani

🎄
working on latest framework...
View GitHub Profile
@i-scorpion
i-scorpion / README.txt
Created June 18, 2012 12:24
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@kevinohara80
kevinohara80 / gist:3095399
Created July 12, 2012 02:58
setTimeout infinite loop
var vm = require('vm');
var code = function run() {
for(var i=0; i<Infinity; i++) {
i++;
}
};
var sandbox = {
setTimeout: setTimeout
@corydeppen
corydeppen / gist:3518666
Created August 29, 2012 20:42
Enable cross-domain Ajax requests using web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<!--
Allow Web API to be called from a different domain.
http://dlr2008.wordpress.com/2012/04/26/asp-net-web-api-cross-domain-ajax-and-server-techniques-jsonp-and-cors/
-->
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@paulocheque
paulocheque / .bash_profile
Last active September 30, 2023 17:26
.bash_profile example
# EDITOR=nano sudo visudo
# Change the following line: (:i to insert + esc to go back + :w to save + :q to quit)
# Defaults env_reset
# to:
# Defaults env_reset,timestamp_timeout=960 # in minutes
export PATH=$PATH:.
# export PATH=$PATH:/usr/bin
var five = require("../lib/johnny-five");
(new five.Board()).on("ready", function() {
var lcd = new five.LCD({
// LCD pin name RS EN DB4 DB5 DB6 DB7
// Arduino pin # 7 8 9 10 11 12
pins: [ 7, 8, 9, 10, 11, 12 ],
rows: 2,
cols: 16
});
@jakejscott
jakejscott / jQuery.antiforgerytoken.js
Created October 3, 2012 00:33 — forked from scottrippey/jQuery.antiforgerytoken.js
ASP.NET MVC AntiForgeryToken + AJAX = jQuery to the rescue
// Setup CSRF safety for AJAX:
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
if (options.type.toUpperCase() === "POST") {
// We need to add the verificationToken to all POSTs
var token = $("input[name^=__RequestVerificationToken]").first();
if (!token.length) return;
var tokenName = token.attr("name");
@erichexter
erichexter / RouteConfig.cs
Created November 22, 2012 01:50
Example of using NavigationRoutes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
// You need to add this using statement to use the MapNavigationRoute extension method.
using NavigationRoutes;
namespace MvcApplication13
{
@mnewt
mnewt / bootstrap-tabs.html
Created December 6, 2012 20:28
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
@mugifly
mugifly / blink.css
Last active May 26, 2024 20:01
CSS Blink for Webkit and others. (Chrome, Safari, Firefox (Gecko), IE, ...) CSSで擬似的なblinkを再現する簡単なTips。