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
javascript:!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.download=t()}(this,function(){return function e(t,n,o){var a,i,r=window,d="application/octet-stream",s=o||d,c=t,l=!n&&!o&&c,u=document.createElement("a"),f=function(e){return String(e)},p=r.Blob||r.MozBlob||r.WebKitBlob||f,m=n||"download";if(p=p.call?p.bind(r):Blob,"true"===String(this)&&(s=(c=[c,s])[0],c=c[1]),l&&l.length<2048&&(m=l.split("/").pop().split("?")[0],u.href=l,-1!==u.href.indexOf(l))){var b=new XMLHttpRequest;return b.open("GET",l,!0),b.responseType="blob",b.onload=function(t){e(t.target.response,m,d)},setTimeout(function(){b.send()},0),b}if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(c)){if(!(c.length>2096103.424&&p!==f))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),m):w(c);s=(c=v(c)).type||d}function v(e){for(var t=e.split(/[:;,]/),n=t[1],o=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),a=o.length,i=0,r=new Uint8Array(a);i<a;++i)r[i]=o.charCodeAt(i);return new p([r],{ty |
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 csv = $('.media-list li.media').map((i, gearDiv) => { | |
var gearName = $(gearDiv).find('.media-heading h5').text(); | |
var totalCount = parseInt($(gearDiv).find('.media-heading p').text().substring(1)); | |
return gearName + ',' + totalCount; | |
}).toArray().join('\n'); | |
csv = "Name,Total\n" + csv; | |
window.download(csv, "FullGearList.csv", "text/csv"); |
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 csv = $('.gl-gear-needed__ingredient-header-primary').map((i, gearDiv) => { | |
var gearName = $(gearDiv).find('.gl-gear-needed__ingredient-header-name').text(); | |
var gearRemainingText = $(gearDiv).find('.gl-gear-needed__progress').attr('title'); | |
var matchResult = gearRemainingText.match(/(\d+) of (\d+)/); | |
var assignedCount = matchResult[1]; | |
var totalCount = matchResult[2]; | |
return gearName + ',' + totalCount + ',' + assignedCount; | |
}).toArray().join('\n'); | |
csv = "Name,Total,Assigned,Hoarded\n" + csv; | |
window.download(csv, "GLGearNeeded.csv", "text/csv"); |
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
javascript:;(function(root,factory){typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?module.exports=factory():root.download=factory()})(this,function(){return function download(data,strFileName,strMimeType){var self=window,defaultMime="application/octet-stream",mimeType=strMimeType||defaultMime,payload=data,url=!strFileName&&!strMimeType&&payload,anchor=document.createElement("a"),toString=function(a){return String(a)},myBlob=self.Blob||self.MozBlob||self.WebKitBlob||toString,fileName=strFileName||"download",blob,reader;myBlob=myBlob.call?myBlob.bind(self):Blob,String(this)==="true"&&(payload=[payload,mimeType],mimeType=payload[0],payload=payload[1]);if(url&&url.length<2048){fileName=url.split("/").pop().split("?")[0],anchor.href=url;if(anchor.href.indexOf(url)!==-1){var ajax=new XMLHttpRequest;return ajax.open("GET",url,!0),ajax.responseType="blob",ajax.onload=function(e){download(e.target.response,fileName,defaultMime)},setTimeout(function(){ajax.send()},0),ajax}}if(/^data:( |
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
void DrawNode::drawSolidRoundedRect(const Vec2 &origin, const Vec2 &destination, float radius, unsigned int segments, const Color4F &color) | |
{ | |
const float coef = 2.0f * (float)M_PI/(segments - 8); | |
Vec2 *vertices = new (std::nothrow) Vec2[segments]; | |
if( ! vertices ) | |
return; | |
// Draw right edge | |
vertices[0].x = destination.x; |
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
ClLCD | |
1→NEWX | |
1→NEWY | |
21→OX | |
8→OY | |
10→NEWSX1 | |
8→NEWSY1 | |
15→NEWSX2 | |
2→NEWSY2 | |
0→TIMER |
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
#!/bin/bash | |
# This script builds the iOS and Mac openSSL libraries | |
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
# | |
# Original: https://gist.github.com/foozmeat/5154962 |
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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.min.js"></script> | |
<script> | |
var app = angular.module('myModule', []); | |
app.directive('leftPanel', function() { | |
return { | |
restrict: 'EA', //E = element, A = attribute, C = class, M = comment |
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
valid([]). | |
valid([Head|Tail]) :- fd_all_different(Head), valid(Tail). | |
sudoku9(Puzzle, Solution) :- | |
Solution = Puzzle, | |
Puzzle = [S11, S12, S13, S14, S15, S16, S17, S18, S19, | |
S21, S22, S23, S24, S25, S26, S27, S28, S29, | |
S31, S32, S33, S34, S35, S36, S37, S38, S39, | |
S41, S42, S43, S44, S45, S46, S47, S48, S49, |
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
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) | |
# Load posh-git module from current directory | |
Import-Module .\posh-git | |
# If module is installed in a default location ($env:PSModulePath), | |
# use this instead (see about_Modules for more information): | |
# Import-Module posh-git | |
function Write-Git-Branch { |
NewerOlder