Skip to content

Instantly share code, notes, and snippets.

@cvuorinen
cvuorinen / autocomplete.js
Last active March 24, 2018 22:11
RxJS & Angular 1 Autocomplete example
angular.module('app', ['rx'])
.directive('autocomplete', function () {
return {
scope: {},
template: '<input ng-model="val" ng-change="update(val)" />' +
'<ul class="suggestions">' +
'<li ng-repeat="suggestion in suggestions">' +
'<a href="https://github.com/{{ suggestion }}"' +
' target="_blank">{{ suggestion }}</a>' +
'</li>' +
@geta6
geta6 / partial.coffee
Created September 27, 2012 10:13
response partial content in node.js
#
# blob : Object from MongoDB
#
# blob.body: Buffer
# blob.size: length of buffer, substitute for blob.body.length
# blob.type: MIME (Eg. audio/x-wav)
#
# req : Object from http
# res : Object from http
# _ : Object from underscore
@crynobone
crynobone / install-oci8.sh
Last active October 4, 2019 18:26
Provision Oracle InstantClient for Ubuntu Vagrant.
#!/usr/bin/env bash
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
echo "Instantclient path: instantclient,/opt/oracle/instantclient"
sudo pecl install oci8
sudo echo "extension=oci8.so" >> /etc/php5/fpm/php.ini
@alexkilla
alexkilla / .bash_profile
Last active May 5, 2021 13:59
This is my bash profile
# Ifortune
# In some cases you might need this
export TZ="UTC"
# This is to avoid to have further problems with compass
export LANG=en_US.UTF-8
export PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export WORKON_HOME=~/Envs
@tcnksm
tcnksm / install_sqlplus.md
Last active February 4, 2022 12:43
How to install oracle client to Ubuntu 12.04

Install SQL*Plus

  1. Download .rpm package here
    • oracle-instantclinet*-basic-*.rpm
    • oracle-instantclinet*-devel-*.rpm
    • oracle-instantclinet*-sqlplus-*.rpm
  2. Install alien (sudo apt-get install alien)
  3. Convert the rpm files and install
    • sudo alien -i oracle-instantclinet*-basic-*.rpm
  • sudo alien -i oracle-instantclinet*-devel-*.rpm
@datagrok
datagrok / git-serve.md
Last active April 21, 2023 07:33
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.
@mrk-han
mrk-han / jenkins-playground-setup.md
Last active August 18, 2023 02:14
Setting up a Jenkins Playground: Download, Setup, Test and Run Groovy Scripts on a Local Jenkins Server Instance with MacOS

Test a Local Jenkins Instance on MacOS: Download, Setup, and Run Groovy Scripts Locally

About

There are many ways to test Jenkins...

Jenkins Pipeline Unit is great but it's generally recommended to keep all of your logic with stages and not get too crazy with custom Groovy in your pipeline. Though, it's a great option if you have a very advanced use-case and want to make sure your code is reliable.

The Replay Pipeline Run Option is awesome if you want to verify a quick change or iterate quickly on a previously setup pipeline. But it only allows for altering Jenkinsfile Code and runs against the production Jenkins Instance.

const CH_BRACE_L = 0x7b as const;
const CH_BRACE_R = 0x7d as const;
const CH_SQUARE_L = 0x5b as const;
const CH_SQUARE_R = 0x5d as const;
const CH_QUOTE_D = 0x22 as const;
const CH_ESCAPE = 0x5c as const;
const CH_COMMA = 0x2c as const;
const CH_COLON = 0x3a as const;
const CH_DOT = 0x2e as const;
const CH_MINUS = 0x2d as const;
@slmingol
slmingol / IAM Permissions List.md
Created September 15, 2019 20:43 — forked from mechcozmo/IAM Permissions List.md
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
@jspiro
jspiro / README.md
Last active October 29, 2023 23:37
How I do my bitcoin taxes

TurboTax has no crypto support, it also doesn't support importing CSVs of transactions, and CreditKarma has no ability to import from financial institutions at all (so e.g. wealthfront is an instant dealbreaker for trying it). Square sends out terrible CSVs of transactions and does very little to help you report for the few bucks you made.

  1. Import transactions to https://app.koinly.io/transactions
  2. Set tax basis to LIFO, print https://app.koinly.io/reports/2019 to PDF
  3. Load https://app.koinly.io/transactions?page=1 and find the transactions JSON transfer in the Network tab, Copy as cURL
  4. In the terminal, paste this, and either remove the gzip line or pipe through gzip, do this for each page, e.g.:
curl 'https://api.koinly.io/api/transactions?page=1&per_page=20' \
    -XGET \
    -H 'Accept: application/json, text/plain, */*' \