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/python | |
# -*- coding: utf-8 -*- | |
import sublime, sublime_plugin | |
import tempfile, subprocess, collections | |
DEBUG_MODE = False | |
IS_OSX = sublime.platform() == 'osx' | |
settings = sublime.load_settings('SpotsManager.sublime-settings') |
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! ExtractProperty() | |
let a_save = @a | |
try | |
let properties_file = expand('%:r').'.properties' | |
if filereadable(properties_file) | |
normal! gv"ay | |
let value = @a | |
let key = substitute(value, ".*", "\\U\\0", "") | |
let key = substitute(key, '\W\+', "_", "g") | |
if len(key) > 20 |
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
DEPLOYER='deployer' | |
DEPLOYER_HOME="/home/$DEPLOYER" | |
PROJECT_NAME='node-js-sample' | |
PROJECT_REPO='https://github.com/heroku/node-js-sample.git' | |
# Provisining an ubuntu server | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install software-properties-common | |
add-apt-repository ppa:chris-lea/node.js |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Mental mapping code smell</title> | |
<style> | |
.language-flag { | |
float: left; | |
} | |
</style> |
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/sh | |
# Must be called with two command-line args. | |
# Example: git-svn-relocate.sh http://old.server https://new.server | |
if [ $# -ne 2 ] | |
then | |
echo "Please invoke this script with two command-line arguments (old and new SVN URLs)." | |
exit $E_NO_ARGS | |
fi | |
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
#include "opencv2/highgui/highgui.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <stdio.h> | |
#include <stdlib.h> | |
using namespace cv; | |
using namespace std; |
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 step = 0; | |
async.waterfall([ | |
function (next){ | |
step = 1; | |
getJson('/country', function(data) { next(null, data); }); | |
}, | |
function (country, next){ | |
step = 2; | |
getJson('/weather', function(data) { next(null, country, 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
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; | |
import javax.script.ScriptException; | |
import org.apache.commons.lang.StringEscapeUtils; | |
import org.codehaus.jackson.map.ObjectMapper; | |
import java.io.ByteArrayOutputStream; |
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
String::pad = (l, s) -> | |
if (l -= @length) > 0 | |
(s = new Array(Math.ceil(l / s.length) + 1).join(s)).substr(0, s.length) + this + s.substr(0, l - s.length) | |
else | |
@ | |
app = angular.module "yoplayApp", ["ngResource"] | |
app.factory "myHttpInterceptor", ["$q", "$window", "$rootScope", ($q, $window, $rootScope) -> | |
(promise) -> |
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
<a id='clickMe' href='#'>Click me</a> |