Skip to content

Instantly share code, notes, and snippets.

@kknights
kknights / eloquentJs_chapter2ex02.js
Last active August 25, 2015 19:14
EJ - FizzBuzz
View eloquentJs_chapter2ex02.js
// FizzBuzz
for (var i = 0; i <= 100; i++){
var results = "";
if(i % 3 === 0) results += "Fizz";
if(i % 5 === 0) results += "Buzz";
console.log(results || i);
}
@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 {
@JohanMoreau
JohanMoreau / updateDocker.sh
Created August 25, 2015 19:17
Docker 1.8 on Ubuntu box
View updateDocker.sh
sudo su
echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D
apt-get update
apt-get purge lxc-docker*
apt-get purge docker.io*
apt-get install docker-engine
exit
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)