Skip to content

Instantly share code, notes, and snippets.

@jskulski
jskulski / Main.elm
Created August 8, 2017 19:45
Elm example throwing error
module Main exposing (..)
import Http
import HttpBuilder exposing (..)
import Date exposing (Date)
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
class SomeObject(object):
def some_func():
dependency = SomeDependency()
dependency.do_something()
# and used in multiple places in many other files...
some_obj = SomeObject()
some_obj.some_func()
@jskulski
jskulski / FlaskApp.py
Created June 27, 2015 04:28
Why does curl -L -X POST --data "body=my+bud" http://localhost:5000/card return a 405 and GET to the same end point return the string?
from flask import Flask, request, redirect, jsonify
app = Flask(__name__)
body = None
@app.route('/cards', methods=['GET'])
def retrieve_card_stack():
global body
if body is not None:
@jskulski
jskulski / gist:ea3be5ef08a385c974b5
Created June 24, 2015 03:44
Yeoman generator dissapearing?
(venv)jskulski@instrument ~/C/j/boneyard-client> npm install generator-mobile
npm WARN peerDependencies The peer dependency yo@>=1.0.0 included from generator-mobile will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
\
> spawn-sync@1.0.11 postinstall /home/jskulski/Code/jskulski/boneyard-client/node_modules/yo/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
@jskulski
jskulski / test_gui_extraction_acceptance.py
Created June 12, 2015 20:52
Creating a simple python spy, simply.
def spy(self):
def spy_function(*args, **kwargs):
spy_function.was_called = True
spy_function.was_called = False
return spy_function
@jskulski
jskulski / test_gui_extraction_acceptance.py
Last active August 29, 2015 14:22
Using the simple spy
def test_that_editing_a_buffer_then_quitting_causes_save_dialog(self):
self.editor.gui.quitdialog.show = self.spy()
editor_input.type_keys('modify the buffer', self.editor)
self.editor.save_dialog_or_quit_editor()
self.assertTrue(self.editor.gui.quitdialog.show.was_called)
<?php
class FileReader {
public function openFile($filePath, $fileMode) {
//... open file
}
public function readFile($filePath) {
(ns loquat.core
(:use
[ring.adapter.jetty :as jetty]))
; Routing
(defroutes main-routes
(GET "/" [] "Hello World"))
// this one
var one = require('one'),
two = require('two'),
three = require('three');
// this one?
var one = require('one'),
two = require('two'),
three = require('three')
;
@jskulski
jskulski / chpwd_update_git_vars.sh
Created March 9, 2012 19:48 — forked from scelis/chpwd_update_git_vars.sh
Add git information to your ZSH prompt.
update_current_git_vars