Skip to content

Instantly share code, notes, and snippets.

@jdnichollsc
jdnichollsc / async.js
Last active June 8, 2021 00:48
Angular mapSeries like Bluebird.js
(function () {
'use strict';
angular
.module('App')
.factory('Async', Async);
Async.$inject = ['$q'];
function Async($q) {
return {
@thecristen
thecristen / chosen-bootstrap.scss
Last active March 24, 2018 15:16 — forked from koenpunt/chosen-bootstrap.css
Bootstrap 3.0 theme for Chosen
// Customized styles for select boxes using the Chosen jQuery plugin
// forked from Bootstrap-themed version at https://gist.github.com/koenpunt/6424137
// This one uses your variables from bootstrap-sass
// by thecristen, at https://gist.github.com/thecristen/e71ed5391fbdc6d63dc3 (no license go nuts)
// TODO: This only covers single select
select.form-control + .chosen-container.chosen-container-single .chosen-single {
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075));
@include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);
display: block;
@savitskiyan
savitskiyan / FileActionResult.cs
Last active November 11, 2015 07:03
ASP.NET MVC 6 WebAPI support partial download file
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
namespace Server.Controllers
{
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@kennethlynne
kennethlynne / angular-mock-backend.js
Last active March 22, 2025 17:37
High fidelity prototyping using a mock back-end. Include angular-mocks in your script includes after angular. Demo: http://codepen.io/kennethlynne/pen/lJbce
'use strict';
angular.module('yourApp')
.constant('Config', {
viewDir: 'views/',
API: {
useMocks: true,
fakeDelay: 2000,
protocol: window.location.protocol.split(':')[0],
host: window.location.hostname,
@IcyMidnight
IcyMidnight / MySQL functions to convert between binary and string uuids
Created July 31, 2009 09:27
MySQL functions to convert between binary and string uuids
DELIMITER |
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE hex CHAR(32);
SET hex = HEX(b);
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12));
END
|