Skip to content

Instantly share code, notes, and snippets.

@ifree
ifree / perf.org
Created June 3, 2019 03:07
nx performance checklist

performance checklist

  • cooling
  • mount rom cache size
  • fs priority
  • file data cache
@ifree
ifree / richhickey.md
Created April 18, 2018 09:28 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@ifree
ifree / dianping.js
Last active April 10, 2018 13:45
export shop detail on dianping.com info to csv
(function(){
function $$get_prop(obj, path) {
return path.split('.').reduce(function(prev, curr) {
return prev ? prev[curr] : ''
}, obj || self)
}
function $$parse_page(doc){
return {
@ifree
ifree / mstodo.py
Last active December 13, 2017 10:14
Microsoft TODO
#!/usr/bin/python
import subprocess, os, json, ast, os.path
from random import randint
from urllib.parse import urlparse
from urllib.parse import parse_qsl
from http.server import BaseHTTPRequestHandler, HTTPServer
import threading
from requests_oauthlib import OAuth2Session, TokenUpdated
from oauthlib.oauth2 import BackendApplicationClient
@ifree
ifree / pixel.h
Last active December 18, 2016 18:18
dumb pixel
template<size_t... ComponentSizes>
class Pixel {
template<size_t... I>
static auto make_components(std::index_sequence<I...>)
{
auto constexpr sizes = std::make_tuple(ComponentSizes...);
//size = offset + sizeI
return std::make_tuple(Bitfield<storage_type, partial_sum<I>::value(sizes), std::get<I>(sizes)>{}...);
}
@ifree
ifree / UtilityExtension.cs
Last active June 3, 2023 12:49
When I realized there is a thing called msbuild, I orz...
static class UtilityExtension
{
//xml utility
public static XAttribute AttributeAnyNS<T>(this T source, string localName)
where T : XElement
{
return source.Attributes().SingleOrDefault(e => e.Name.LocalName == localName);
}
public static IEnumerable<XElement> ElementsAnyNS<T>(this T source, string localName)
@ifree
ifree / _vimrc
Created April 1, 2016 11:52
visual studio vsvim plugin emacs mode
" Command line and search patterns history
set history=10000
" Show pattern matches as you type
set incsearch
" Hilight previous search pattern matches
set hlsearch
" Override ignorecase if pattern has uppercase chars
@ifree
ifree / coursera2aria2c.js
Created December 8, 2015 15:37
coursera-aria2c
Array.prototype.forEach.call(
document.querySelectorAll('.course-lecture-item-resource'),
function(item){
let rpc_add = function(uri, out){
return [{"jsonrpc":"2.0"
,"method":"aria2.addUri"
,"id":1
,"params":[
[uri]
,{"out" : out
@ifree
ifree / cmake-tool.el
Created October 13, 2015 16:20
Automatically tracking source files for cmake project
;;; cmake-tool.el --- CMake utility functions
;;; Commentary:
;;
;;; Code:
(require 'cmake-mode)
(defvar cmake-tool-target-var-name "cmake-tool-target-var"
"Variable name that cmake-tool will look for to manipulate.")