Skip to content

Instantly share code, notes, and snippets.

@piecyk
piecyk / robot.js
Created December 4, 2012 12:05 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
var gulp = require('gulp');
var browserify = require('browserify');
var notify = require('gulp-notify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
var csso = require('gulp-csso');
var watch = require('gulp-watch');
var envify = require('envify');
(require 'ansi-color)
(defvar karma-buffer
"*karma-node-specs-buffer*")
(defun karma-compile ()
"Run Karma"
(interactive)
(shell-command "karma run" (get-buffer-create karma-buffer))
(display-buffer karma-buffer)
(with-current-buffer karma-buffer

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

package com.example.actors.github
import spray.httpx.Json4sSupport
import org.json4s.{DefaultFormats, Formats}
/**
* Marshalling/Unmarshalling for the github json format
*
* see http://developer.github.com/v3/oauth/#web-application-flow
*/
@piecyk
piecyk / config.js
Last active August 29, 2015 14:18 — forked from mccahill/config.js
module.exports = {
'HOSTPATH': 'http://your.host.here',
'PORT': 80,
'EXPRESS_SESSION_SECRET': '123456',
'TWITTER_CONSUMER_KEY': 'your-consumer-key-here',
'TWITTER_CONSUMER_SECRET': 'your-secret-here',
'GOOGLE_APP_ID': 'your-app-id-here',
'GOOGLE_CONSUMER_SECRET': 'your-consumer-secret-here',
};
(add-hook 'js-mode-hook '(lambda ()
;; /home/hvesalai/projects/foo/Bar.jsx: line 6, col 63
(add-to-list 'compilation-error-regexp-alist-alist
`(eslint-compact
,(rx line-start
(group (zero-or-one letter ":") (1+ (not (any ": "))))
": line " (group (1+ digit))
", col " (group (1+ digit)))
1 2 3))
@piecyk
piecyk / ScalaEnum.scala
Last active August 29, 2015 14:27 — forked from viktorklang/ScalaEnum.scala
DIY Scala Enums (with optional exhaustiveness checking)
trait Enum { //DIY enum type
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia
type EnumVal <: Value //This is a type that needs to be found in the implementing class
private val _values = new AtomicReference(Vector[EnumVal]()) //Stores our enum values
//Adds an EnumVal to our storage, uses CCAS to make sure it's thread safe, returns the ordinal
private final def addEnumVal(newVal: EnumVal): Int = { import _values.{get, compareAndSet => CAS}
val oldVec = get
@piecyk
piecyk / bloop.js
Last active September 22, 2015 11:19 — forked from jlongster/bloop.js
bloop
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
@piecyk
piecyk / postgis.clj
Created October 6, 2015 10:21 — forked from attentive/postgis.clj
PostGIS and Korma
(ns postgis
(:require [clj-json.core :as json])
(:use korma.core korma.db korma.sql.engine))
(defn intersects [first-geom second-geom]
"An extended Korma predicate that uses the PostGIS function ST_Intersects."
(sql-func "ST_Intersects" first-geom second-geom))
(defn from-wkt [wkt]
"Create a PostGIS geometry with geographic SRID from WKT using ST_GeomFromText."