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
/* | |
MIT Licence | |
Copyright © 2015 Noj Vek | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
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
// Watch for changes and auto-reload | |
// CSS changes get auto injected, js changes reload current page | |
var pollInterval = 2; // check every 2 seconds | |
var jsMap = {"powerbi.js":null, "powerbicommon.js":null}; | |
var cssMap = {"powerbi.css":null, "powerbicommon.css": null}; | |
function getLastModifiedTime(url, callback) { | |
$.ajax({ | |
type: "HEAD", // HEAD only gives headers, a lot faster | |
url: url, |
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
import os | |
import re | |
#whatever filter you would like to apply | |
os.system('find * -type f | egrep -v ".svn" | egrep "\.(js|mustache|css|html|txt|less|sass|as|cfml|mxml)$" > /tmp/sourcefiles.txt') | |
with open('/tmp/sourcefiles.txt') as f: | |
files = f.read().strip().split("\n") | |
for file in files: |
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
fs = require 'fs' | |
XXHash = require 'xxhash' | |
path = require 'path' | |
#dive = require 'dive' | |
HashStream = XXHash.Stream | |
c = console | |
startTime = Date.now() | |
mapFileName = 'pbix.json' | |
rootDir = '../pbix' |
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
fs = require 'fs' | |
readline = require 'readline' | |
path = require 'path' | |
c = console | |
### | |
# Helpers | |
### | |
parseCliForPath = -> |
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
sudo apt-get install ufw | |
sudo ufw default deny incoming | |
sudo ufw default allow outgoing | |
sudo ufw allow ssh | |
sudo ufw allow http | |
sudo ufw allow 9000 | |
sudo ufw allow 9001 | |
sudo ufw allow 9002 | |
sudo ufw status verbose | |
#sudo ufw enable |
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 render() | |
const todos = @.props.model.todos | |
let shownTodos = todos.filter (todo) -> | |
switch @.state.nowShowing | |
case ACTIVE_TODOS: | |
-< !todo.completed | |
case COMPLETED_TODOS: | |
-< todo.completed | |
default: |
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
import Image | |
import sys | |
import glob | |
# Trim all png images with alpha in a folder | |
# Usage "python PNGAlphaTrim.py ../someFolder" | |
try: | |
folderName = sys.argv[1] | |
except : |
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
const MIN_HEIGHT = 4 | |
const MAX_HEIGHT = 8 | |
const HEIGHT_DELTA = MAX_HEIGHT - MIN_HEIGHT | |
interface Path { | |
startIndex: number | |
startHeight: number | |
endIndex: number | |
endHeight: number | |
} |
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
/** | |
* Suppose there was an Object.map function similar to Array.map | |
* There is some discussion about this on es-discuss but no one has filed a formal proposal yet (someone should!) | |
* @param {Object} object | |
* @param {function} callback | |
*/ | |
Object.map = function(object, callback) { | |
if (!object) { | |
throw new TypeError(`object is null or not defined`); | |
} |
OlderNewer