Skip to content

Instantly share code, notes, and snippets.

View d2s's full-sized avatar

Daniel Schildt d2s

View GitHub Profile

###Yaml and HAML

What is YAML and HAML?

What does YAML stand for??
YAML: YAML Ain't Markup Language (Yet Another Markup Language) it was changed to distinguish its purpose as data-oriented and rather than a document markup

  • YAML was created to easily map data types such as lists and arrays.
  • YAML is structured in a way that is easy for human to read, like an outline
  • YAML doesn't use enclosures such as quotation marks, brackets, braces and open/close tags.
  • spaces and indentations are not important as long as parallel elements have the same left justification and nested elements are indented further

Most active public GitHub users in Finland

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Fri, 13 Dec 2013 15:07:05 GMT till Sat, 13 Dec 2014 15:07:05 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -> user.followers > 11)
@colinmeinke
colinmeinke / class-naming.md
Last active August 29, 2015 14:16
Class naming

Harry Roberts has written an epic article where he suggests breaking down classes into objects (o-), components (c-), utilities (u-), themes (t-), states (is-, has-) and a couple of others (_, js-, qa-). He uses this namespacing method to make the code he writes more readable and maintainable at scale.

I've got a slightly different take on it. I would argue that Harry's method of adding class types adds complexity to our CSS. With BEM naming conventions and Sass I believe

@0xnbk
0xnbk / .php
Created September 13, 2010 08:33
Get Your Most Recent Twitter Status (PHP)
<?php
function get_status($twitter_id, $hyperlinks = true) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$src = curl_exec($c);
curl_close($c);
preg_match('/<text>(.*)<\/text>/', $src, $m);
$status = htmlentities($m[1]);
if( $hyperlinks ) $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $status);
@apoikola
apoikola / 2012_ehdokkaat_ammattien_putsaus_refine
Created October 6, 2012 16:20
2012 Kunnallisvaaliehdokkaiden ammattien siivous Google Refinella
[
{
"op": "core/multivalued-cell-split",
"description": "Split multi-valued cells in column Ammatti",
"columnName": "Ammatti",
"keyColumnName": "RowIndex",
"separator": ",",
"mode": "plain"
},
{
anonymous
anonymous / haetaan_koodaria.md
Created February 9, 2013 15:32
Haetaan todellista geekkiä niin omituiseen duuniin, että ei ole ennen nähty. Ota yhteyttä jos naurattaa ja jos olet etsimämme mies (tai nainen). Btw. Jos haluat tästä nätimmän version niin aja se jonku Markdown-mankelin läpi.

Haetaan:

Koodi(orja)apina

Speksit:

Sinun täytyy osata ainakin seuraavat:

  • Django
  • Node.js
@amscotti
amscotti / server.js
Last active December 15, 2015 09:09
Proxy server for working with Yeoman and a REST API. Install http-proxy by running 'npm install http-proxy' or add to your package.json and run 'npm install'
var httpProxy = require('http-proxy'),
staticDir = 'app',
apiHost = '<Your API Host>',
apiPort = 80,
apiPath = '/api';
var proxy = new httpProxy.RoutingProxy();
connect()
.use(connect.logger("dev"))
.use(function (req, res, next) {
@tts
tts / twsentiment2.R
Last active December 19, 2015 15:08
Yet another light-weight sentiment analysis of the last updates of my English-writing Twitter followers
########################################################################################################
#
# Making - yet another - light-weight sentiment analysis of the last updates
# of my English-writing Twitter followers.
#
# Algorithm by
# http://jeffreybreen.wordpress.com/2011/07/04/twitter-text-mining-r-slides/
# https://github.com/jeffreybreen/twitter-sentiment-analysis-tutorial-201107/blob/master/R/sentiment.R
#
# Word list from
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
server_name example.com;
root /var/www;
@defunkt
defunkt / installing-mustache.vim.md
Created March 6, 2010 10:21
Installing mustache.vim

mustache.vim

In your shell:

cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/

rm -rf mustache.vim