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 BaseService from './base.service'; | |
class AnalyticsService extends BaseService { | |
constructor($http) { | |
'ngInject'; | |
super(...arguments); | |
} | |
fetchSomething() { | |
return this.$http.get('/api/analytics/something'); |
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
#!/usr/bin/env python | |
from collections import defaultdict | |
import json | |
import sys | |
MIN_WORD_LEN = 2 | |
def groupByAnagrams(inputFile): | |
''' inputFile should have one word per line ''' |
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
<?php | |
class Sitemap { | |
/** | |
* Maximum size of a single sitemap file. | |
* Defaults to 9MB | |
*/ | |
public $maxFileSize = 9437184; |
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
from PIL import Image, ImageDraw | |
import argparse | |
import sys | |
def get_colors(image_file, numcolors=10, resize=150): | |
# Resize image to speed up processing | |
img = Image.open(image_file) | |
img = img.copy() | |
img.thumbnail((resize, resize)) |
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 | |
CAKE_SITES_PATH="/home/stefan/wwwroot/cake/" | |
BASE_APP_PATH="/home/stefan/wwwroot/cake/app" | |
APACHE_VHOSTS_CONFIG="/etc/apache2/sites-enabled/all" | |
HOSTS_FILE="/etc/hosts" | |
if [ $# -ne 1 ] | |
then | |
echo "Usage - $0 project 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
<?php | |
/** | |
* GET Params: | |
* dir => dir name | |
* abspath => true/false | |
*/ | |
header('Content-type: application/json'); |