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
<client> | |
<firstname>Aly</firstname> | |
<lastname>Saleem</lastname> | |
<occupation permenant="true">Dentist</occupation> | |
</client> | |
<client> | |
<firstname>Mohammed</firstname> | |
<lastname>Ali</lastname> | |
<occupation permenant="false">Salesman</occupation> | |
</client> |
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
/* paste this at the top: */ | |
@import url('https://fonts.googleapis.com/css?family=Open+Sans'); | |
/* paste this at the bottom: */ | |
.highlight { | |
background: #fff; | |
} | |
.highlighter-rouge .highlight { |
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
function getPi(){ | |
function getRand(maxRand){ | |
return Math.floor(Math.random()*maxRand); | |
} | |
function gcd(a,b) { | |
if (!b) return a; | |
else return gcd(b,a%b); | |
}; | |
let coPrimes = 0; | |
const iterations = 10000000; |
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
/// <reference path="../node_modules/@types/node/index.d.ts"/> | |
import * as fs from "fs"; | |
import {join,resolve} from "path"; | |
import marked = require("marked"); | |
import handlebars = require("handlebars"); | |
import mkdirp = require("mkdirp"); | |
// retrieve a list of all the files in a given directory | |
function walkSync (dir:string, fileList?:string[]) { | |
const files = fs.readdirSync(dir).map((x)=>join(resolve(dir),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
.vs-dark .monaco-workbench { | |
--input-bgcolor: #3c3c3c; | |
background-color: red; | |
color: #e7e7e7; | |
} |
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 React = { | |
createElement: function (tag, attrs, children) { | |
var e = document.createElement(tag); | |
// Add attributes | |
for (var name in attrs) { | |
if (name && attrs.hasOwnProperty(name)) { | |
var v = attrs[name]; | |
if (v === true) { | |
e.setAttribute(name, name); |
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
function decode_if_b64($file_content="",$return_boolean=false) { | |
/** | |
* | |
* Base64 files handling | |
* 1. first we'll check if it's a base64 data URI | |
* and we'll strip the data uri initials | |
* | |
* 2. Confirm it using regular expression |
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
function mime2ext($mime){ | |
$all_mimes = '{"png":["image\/png","image\/x-png"],"bmp":["image\/bmp","image\/x-bmp","image\/x-bitmap","image\/x-xbitmap","image\/x-win-bitmap","image\/x-windows-bmp","image\/ms-bmp","image\/x-ms-bmp","application\/bmp","application\/x-bmp","application\/x-win-bitmap"],"gif":["image\/gif"],"jpeg":["image\/jpeg","image\/pjpeg"],"xspf":["application\/xspf+xml"],"vlc":["application\/videolan"],"wmv":["video\/x-ms-wmv","video\/x-ms-asf"],"au":["audio\/x-au"],"ac3":["audio\/ac3"],"flac":["audio\/x-flac"],"ogg":["audio\/ogg","video\/ogg","application\/ogg"],"kmz":["application\/vnd.google-earth.kmz"],"kml":["application\/vnd.google-earth.kml+xml"],"rtx":["text\/richtext"],"rtf":["text\/rtf"],"jar":["application\/java-archive","application\/x-java-application","application\/x-jar"],"zip":["application\/x-zip","application\/zip","application\/x-zip-compressed","application\/s-compressed","multipart\/x-zip"],"7zip":["application\/x-compressed"],"xml":["application\/xml","text\/xml"],"svg": |
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
/** | |
* | |
* input file => data URI | |
* image => cropped image | |
* | |
**/ | |
(function($) { | |
/** |
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
$.file2URI = function (obj) { | |
if (obj.el.files && obj.el.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
obj.success(e.target.result); | |
} | |
reader.readAsDataURL(obj.el.files[0]); | |
} | |
else { | |
obj.error(); |
NewerOlder