Skip to content

Instantly share code, notes, and snippets.

View martinpinto's full-sized avatar

Martin martinpinto

  • Frankfurt am Main
View GitHub Profile
var walked = [];
var searchHaystack = function(haystack, needle, path, exactEquals) {
//dumb truthiness handling
exactEquals = exactEquals ? true : false;
if(typeof haystack != "object") {
console.warn("non-object haystack at " + path.join("."));
return [false, null];
@martinpinto
martinpinto / gist:3aa5ae020d28f37ec05472cf28ba65db
Created July 24, 2017 16:14 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@martinpinto
martinpinto / App.js
Created November 7, 2016 19:43
Sample application using version 3.0.0 of react-bootstrap-table
import React, { Component } from 'react';
import './App.css';
import ReactTable from './react-sample-table';
class App extends Component {
render() {
return (
<div className="main main-raised">
<div className="container">
<ReactTable />
@martinpinto
martinpinto / cityhash.rs
Last active August 29, 2015 14:25
A rust implementation of CityHash
use std::mem;
fn main() {
}
fn cityhash32(mut s: &[u8], len: usize) -> u32 { // mut s: &[u8]
if len <= 24 {
return if len <= 12 {
if len <= 4 {
hash32Len0to4(s, len)
@martinpinto
martinpinto / pinto_sort.js
Last active August 29, 2015 14:20
Pinto Sort
function swap(arr, a, b) {
var tmp = arr[a];
arr[a] = arr[b];
arr[b] = tmp;
}
function sort(arr) {
var i = 0;
var isSorting = false;
while (i < arr.length) {
/* iterative fibonacci sequence O(n) */
function fibo(n) {
var fiboArr = [0, 1];
for (var i = 1; i < n; i++) {
fiboArr.push(fiboArr[i - 1] + fiboArr[i]);
}
return fiboArr;
}
function fiboSum(n) {
/* iterative fibonacci sequence O(n) */
function fibo(n) {
var fiboArr = [0, 1];
for (var i = 1; i < n; i++) {
fiboArr.push(fiboArr[i - 1] + fiboArr[i]);
}
return fiboArr;
}
function fiboSum(n) {
@martinpinto
martinpinto / gist:71394cd2350245b9e1ab
Created February 12, 2015 15:05
Project Euler Part 1
function multiples() {
var sum = 0;
for (var i = 0; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0)
sum += i;
}
return sum;
}