Skip to content

Instantly share code, notes, and snippets.

@SharpCoder
SharpCoder / outline.md
Created August 25, 2015 19:15
NaNoGenMo 16
View outline.md

Overview

Generating a story will all be piped through the architect. A system that essentially takes a cahracter/action tuple and outputs a narration that describes the event. The difference is, the architect will assign a positive or negative rating to the character/action tuple which can then be fed back into the character for learning. The character will determine whether this action was appropriate at the time and, given various environmental variables, will hopefully learn to make actions that advance the story.

Actors

All characters in the world will have the ability to invoke an action. Tentatively, these actions will include the following:

  • Use an Item
  • Drop an Item
  • Pick up an Item
  • Attack Another
  • Move about the World
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mjsxi
mjsxi / SassMeister-input.scss
Created August 25, 2015 19:16
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
$small: nothing;
@mixin testSmall($s: null) {
@if ($s == nothing) {
display: none
} @else {
View layout.html
<nav-bar>
<dropdown class="visible-sm"></dropdown>
</nav-bar>
<side-bar class="col-md-3 hidden-sm">
<!--- elements of the menu -->
</side-bar>
<div class="container-fluid">
<div class="row">
<!-- the messages -->
View index.js
var React = require('react');
var ContentToggle = React.createClass({
render () {
return (
<div className="ContentToggle">
<div className="ContentToggle__Summary">{this.props.summary}</div>
<div className="ContentToggle__Details">Details</div>
</div>
);
}
@mjsxi
mjsxi / SassMeister-input.scss
Last active August 25, 2015 19:21
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
/* first test */
$small: nothing; // fallback for images not uploaded
@mixin testSmall($s: null) {
@if ($s == nothing) {
View archive-product.php
<?php
/*
* WP_Query - Show in your result search page, How many, products were found.
*/
$mySearch =& new WP_Query("s=$s & showposts=-1"); $num = $mySearch->post_count; ?>
<h1 class="page-title search-products-alert">
Foram encontrados <strong><?php echo $num;?></strong> resultados para a busca: <strong><?php echo get_search_query(); ?></strong>
</h1>
@houshuang
houshuang / cleanup.R
Last active August 25, 2015 19:25
stops working beyond a certain number of elements
View cleanup.R
elem = function(x,y) { x[[y]]}
splitspc = . %>% as.character %>% strsplit(' ', fixed=TRUE) %>% unlist
a = dbraw$V6 %>% head(n=10000000) %>% laply(splitspc)
method =a[1,]
url = a[2,]
# output:
# > a = dbraw$V6 %>% head(n=100) %>% laply(splitspc)
# > a = dbraw$V6 %>% head(n=1000) %>% laply(splitspc)
# > a = dbraw$V6 %>% head(n=10000) %>% laply(splitspc)
View promise.js
/*** inside Angular **/
var someService = function($q, $http) {
var service = this;
service.findSomething = function(query) {
var somePromise = $q.defer()
$http.get(/*something well done here */).then(function(data){
somePromise.resolve(data);
@nabijaczleweli
nabijaczleweli / maker.awk
Last active August 25, 2015 19:27
Conversion script
View maker.awk
#!/usr/bin/awk -f
BEGIN {
place = 1
}
/{/ {
sub(/[\[ ] { /, "")
sub(/ ]/, "")
gsub(/},/, "")