Skip to content

Instantly share code, notes, and snippets.

Avatar

Jiri Pospisil jiripospisil

View GitHub Profile
View gist:dba978af301764097efd
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb
index 1f10378..c864571 100644
--- a/actionview/lib/action_view/digestor.rb
+++ b/actionview/lib/action_view/digestor.rb
@@ -73,11 +73,15 @@ module ActionView
[] # File doesn't exist, so no dependencies
end
- def nested_dependencies
- dependencies.collect do |dependency|
View gist:9268463
var Firebase = require("firebase");
var crypto = require("crypto");
var util = require("util");
var hash = crypto.createHash("sha256").update("test").digest("base64");
var ref = new Firebase("https://atom-firepad.firebaseio.com").child(hash);
ref.on("value", function(snapshot) {
console.log(util.inspect(snapshot.val(), {
showHidden: true, depth: null
View kruskal_minimum_spanning_tree.cc
#include <boost/format.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <iostream>
namespace
{
namespace b = boost;
typedef b::adjacency_list<b::vecS, b::vecS, b::undirectedS, b::no_property,
@jiripospisil
jiripospisil / kk.cc
Created Nov 11, 2013
Fibonacci numbers using gmp
View kk.cc
#include <iostream>
#include <gmpxx.h>
int main(int argc, const char** argv)
{
mpz_class res;
mpz_fib_ui(res.get_mpz_t(), 20e6);
std::cout << res.get_str(10) << std::endl;
return 0;
}
View merge_sort.cc
// Author: Stephan T. Lavavej
// Code for "Stephan T. Lavavej - Core C++, 8 of n" from Channel 9 Videos
#include <iostream>
#include <array>
#include <climits>
using namespace std;
template<int... Vals>
View asd.cc
#include <iostream>
template<typename T>
struct type_trait
{
template<typename U>
struct pointer_trait
{
enum { result = false };
};
View server.go
package main
import (
"encoding/json"
"log"
"net/http"
"runtime"
)
type Article struct {
@jiripospisil
jiripospisil / app.js
Created Jun 7, 2013
Ember.js: Resolve templates using ajax
View app.js
App = Ember.Application.create({
resolver: Ember.DefaultResolver.extend({
resolveTemplate: function (parsedName) {
var template = this._super(parsedName);
if (!template) {
var templateName = parsedName.fullNameWithoutType.replace(/\./g, "/"),
filePath = "/assets/templates/" + templateName + ".js";
$.ajax({
View auth.js
App.Auth = Ember.Auth.create({
// ...
modules: ["emberModel"]
});
View 1.hs
fac :: Int -> Int
fac 0 = 1
fac n = n * fac(n - 1)
-- fac 100 => 0
You can’t perform that action at this time.