Skip to content

Instantly share code, notes, and snippets.

View peterblazejewicz's full-sized avatar
:octocat:
@code #remote #ssh #raspberrypi

Piotr Błażejewicz (Peter Blazejewicz) peterblazejewicz

:octocat:
@code #remote #ssh #raspberrypi
View GitHub Profile
@peterblazejewicz
peterblazejewicz / gist:9757192256b744e5fc15
Created January 10, 2015 13:59
Add language attribute to global template
<!DOCTYPE html><html lang="en"><head><!--.
.---._-------------------------------------+
___________/ ._____) |
) __| HEY HACKER! MARIONETTE IS |
__| EVEN COOLER WHEN YOU USE THE |
..---------.._____| INSPECTOR. http://goo.gl/Wo3pju |
+------------------------------------+
.--><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>Marionette.js – The Backbone Framework</title><meta content="A scalable and composite application architecture." name="description"><meta name="viewport" content="width=device-width"><meta name="twitter:card" value="The Backbone Framework"><meta name="twitter:site" value="@marionettejs"><meta property="og:site_name" content="Marionette.js"><meta property="og:image" content="images/marionette_logo.png"><meta property="og:url" content="http://marionettejs.com"><meta property="og:description" content="Marionette simplifies your Backbone app
@peterblazejewicz
peterblazejewicz / index.js
Created January 17, 2015 15:18
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Rebuild to run it on the right
var html = require('html-template')();
var skills = html.template('skill');
skills.write({
'[key=name]': 'tap dancing',
'[key=level]': '15%'
});
skills.write({
diff --git a/app/index.js b/app/index.js
index a440ea3..a5e9ab6 100644
--- a/app/index.js
+++ b/app/index.js
@@ -1,4 +1,5 @@
'use strict';
+var path = require('path');
var yeoman = require('yeoman-generator');
var yosay = require('yosay');
var chalk = require('chalk');
>> File "src/stylesheets/_about.scss" changed.
Running "notify:preCSS" (notify) task
Running "sass:dev" (sass) task
Running "postcss:dev" (postcss) task
File dist/styles/api.css created.
File dist/styles/api.css.map created (source map).
File dist/styles/docs.css created.
@peterblazejewicz
peterblazejewicz / marionettejs.txt
Last active August 29, 2015 14:15
Marionettejs.com as page of text from a book
Marionette (BUTTON) Toggle menu
* Docs·
* Annotated Source·
* Support·
* Blog·
* GitHub @marionettejs
Marionette logo
Marionette.js
@peterblazejewicz
peterblazejewicz / gist:7776626c014320c8a941
Last active August 29, 2015 14:15
Marionette.js schemas
rdfanode
resource = http://marionettejs.com/
http://ogp.me/ns#site_name = Marionette.js
http://ogp.me/ns#image = images/marionette_logo.png
http://ogp.me/ns#url = http://marionettejs.com
http://ogp.me/ns#description = Marionette simplifies your Backbone application code with robust views and architecture solutions.
http://ogp.me/ns#title = The Backbone Framework
webapplication
itemType = http://schema.org/WebApplication
@peterblazejewicz
peterblazejewicz / gist:d0fab0bbb286d9cf457d
Created February 18, 2015 14:18
Update AntiForgery tokens on Ajax request - both Http cookie and form tokens
/// <summary>
/// resets AntiForgery validation token and update a cookie
/// The new antiforgery cookie is set as the results and sent
/// back to client with Ajax
/// </summary>
/// <param name="Request">request from current context</param>
/// <returns>string - a form token to pass to AJAX response</returns>
private string UpdateRequestVerificationToken(HttpRequestBase Request)
{
string formToken;
@peterblazejewicz
peterblazejewicz / pr.md
Last active August 29, 2015 14:26 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@peterblazejewicz
peterblazejewicz / gist:936484
Created April 22, 2011 11:36
locally save and load data example snippet
protected function saveToFileHandler(event:MouseEvent):void
{
var data:String = inputText.text;
debug("data to save: "+data);
var path:String = mdm.Application.path+"myFile.txt";
debug("saving data at: "+path);
mdm.FileSystem.saveFileUnicode(path, data);
// now load it back
var request:URLRequest = new URLRequest(path);
urlLoader = new URLLoader();
@peterblazejewicz
peterblazejewicz / gist:946107
Created April 28, 2011 09:56
helper to compute paths
/**
* this method help to construct paths
* at runtime and will work during authoring
* and in ZINC application and on Win/Mac/Linux
*/
public function getPath(path:String):String
{
if(mdm.Application && mdm.Application.path.length > 0)
{
path = "file://"+mdm.Application.path.split("\\").join("/")+path;