This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "tbs4", | |
"version": "1.0.0", | |
"description": "A Twitter Bootstrap 4 starter theme", | |
"main": "index.js", | |
"scripts": { | |
"dev": "webpack", | |
"build": "webpack", | |
"watch": "webpack --watch", | |
"production": "cross-env NODE_ENV=production webpack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array_chunk = function(array, size) { | |
var output = [], | |
i = 0, | |
n = 0; | |
for(item in array) { | |
if(i >= size) { | |
i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImageResize | |
{ | |
public enum Dimensions | |
{ | |
Width, | |
Height | |
} | |
public enum AnchorPosition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create the interface | |
interface ICustomPrincipal : IPrincipal | |
{ | |
int UserId { get; set; } | |
string FirstName { get; set; } | |
string LastName { get; set; } | |
} | |
CustomPrincipal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Drop all non-system stored procs */ | |
DECLARE @name VARCHAR(128) | |
DECLARE @SQL VARCHAR(254) | |
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name]) | |
WHILE @name is not null | |
BEGIN | |
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']' | |
EXEC (@SQL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an object named "app" which we can define methods on | |
var app = { | |
// returns an array of each url to prefetch | |
prefetchLinks: function(){ | |
// returns an array of each a.prefetch link's href | |
var hrefs = $("a.prefetch").map(function(index, domElement){ | |
return $(this).attr("href"); | |
}); | |
// returns the array of hrefs without duplicates | |
return $.unique(hrefs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET NOCOUNT ON | |
SET ROWCOUNT 1 | |
WHILE 1 = 1 | |
BEGIN | |
DELETE FROM major | |
WHERE name IN (SELECT name | |
FROM Major | |
GROUP BY name | |
HAVING COUNT(*) > 1) | |
IF @@Rowcount = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($){ | |
$('select').each(function(i, e){ | |
if (!($(e).data('convert') == 'no')) { | |
$(e).hide().wrap('<div class="btn-group" id="select-group-' + i + '" />'); | |
var select = $('#select-group-' + i); | |
var current = ($(e).val()) ? $(e).val(): ' '; | |
select.html('<input type="hidden" value="' + $(e).val() + '" name="' + $(e).attr('name') + '" id="' + $(e).attr('id') + '" class="' + $(e).attr('class') + '" /><a class="btn" href="javascript:;">' + current + '</a><a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:;"><span class="caret"></span></a><ul class="dropdown-menu"></ul>'); | |
$(e).find('option').each(function(o,q) { | |
select.find('.dropdown-menu').append('<li><a href="javascript:;" data-value="' + $(q).attr('value') + '">' + $(q).text() + '</a></li>'); | |
if ($(q).attr('selected')) select.find('.dropdown-menu li:eq(' + o + ')').click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isCtrl = false;$(document).keyup(function (e) { | |
if(e.which == 17) isCtrl=false; | |
}).keydown(function (e) { | |
if(e.which == 17) isCtrl=true; | |
if(e.which == 83 && isCtrl == true) { | |
alert('Keyboard shortcuts + JQuery are even more cool!'); | |
return false; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Shared styles */ | |
.drop-shadow { | |
position:relative; | |
float:left; | |
width:40%; | |
padding:1em; | |
margin:2em 10px 4em; | |
background:#fff; | |
-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; |
NewerOlder