Skip to content

Instantly share code, notes, and snippets.

View Narven's full-sized avatar
👾
Walking to the fridge...

P Ξ D R O L U Z Narven

👾
Walking to the fridge...
View GitHub Profile
@andreia
andreia / gist:1172483
Created August 26, 2011 01:33
Doctrine: Avoiding circular references using the free() function
<?php
$qs = Doctrine_Query::create()
->from('MyTable1 m')
->leftJoin('m.MyTable2 p');
$res = $qs->execute();
$qs->free();
@andreia
andreia / gist:4156693
Created November 27, 2012 20:07
Markdown to HTML
$ curl --data-binary @README.md -H 'Content-Type:text/plain' https://api.github.com/markdown/raw
@james2doyle
james2doyle / NodeWebkit.sublime-build
Created January 31, 2013 16:44
Sublime Text 2 build system for Node Webkit
{
"cmd": ["node-webkit", "${project_path:${folder}}"],
"working_dir": "${project_path:${folder}}",
"path": "/Applications/node-webkit.app/Contents/MacOS/"
}
@nachiket-p
nachiket-p / meteor_servercall.html
Created June 21, 2012 07:41
Meteor: Calling server method from client
<head>
<title>meteor_servercall</title>
</head>
<body>
{{> simple}}
{{> passData}}
</body>
<template name="simple">
@justinmc
justinmc / gist:9149719
Last active October 15, 2018 18:05
Sample Gulpfile
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
@remy
remy / project-structure.md
Last active February 18, 2019 03:35
My (general) new node project directory structure

Project structure

Example project directory, the root folders are pretty consistent, the sub directories (on lib, etc) are just examples of what might be in there.

.
├── lib
│   ├── db
│   ├── handlers
│   └── routes
@eswak
eswak / mochachaisinon.js
Last active April 16, 2019 14:21
An example of asynchronous JavaScript testing using Mocha + Chai + Sinon
var chai = require('chai');
var assert = chai.assert;
var expect = chai.expect;
var should = chai.should();
var sinon = require('sinon');
function myAsyncFunction(callback) {
// 50ms delay before callback
setTimeout(function() {
console.log('hello');
@erica
erica / 00-dragndrop.swift
Last active June 28, 2020 14:52
Building an OSX Drag and Drop Playground: Throw the dragndrop.swift into shared Sources and then test out the examples in individual playgrounds. Make sure the assistant is open and set to the timeline. I prefer vertical assistant stacking for this.
import Cocoa
// Support Foundation calls on String
public extension String { public var ns: NSString {return self as NSString} }
/// Custom Labeled Playground-Based Drag-and-Drop window
public class DropView: NSTextField {
// Default action handler
public var handler: ([String]) -> Void = { paths in Swift.print(paths) }
@jlauemoeller
jlauemoeller / phoenix-and-vue-with-brunch.md
Last active July 14, 2020 21:25
Setting up a Basic Phoenix+Vue+Brunch project

Work in Progress: Phoenix + Vue + Brunch

This documents how I integrate Vue 2.0 with Phoenix 1.x using the default brunch pipeline.

The toolchain

Start out by adding the vue-brunch plugin. You will need a version later than 1.2.3 in order to be able to use the extractCSS option (see later). At the time of writing, 1.2.3 was still the version fetched by npm so I suggest just getting the tip of the dev branch for now (this branch is for Vue 2.0 compatibility anyway):

npm install git+https://github.com/nblackburn/vue-brunch.git#dev --save-dev
@Narven
Narven / .env
Last active October 8, 2020 16:31
Docker compose config for fast postgres
POSTGRES_USER=REPLACE
POSTGRES_PASSWORD=REPLACE
POSTGRES_DB=REPLACE_dev
POSTGRES_HOST=localhost