Skip to content

Instantly share code, notes, and snippets.

View tajo's full-sized avatar
🙌
Use Ladle. Be happy.

Vojtech Miksu tajo

🙌
Use Ladle. Be happy.
View GitHub Profile
@tajo
tajo / gitstatus.py
Last active October 15, 2019 00:04
tajo.zsh-theme
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import re
import shlex
from subprocess import Popen, PIPE, check_output
@tajo
tajo / .zshrc
Created October 13, 2019 09:16
.zshrc
export ZSH="/Users/miksu/.oh-my-zsh"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
ZSH_THEME="robbyrussell"
# https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git
# https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/yarn
# https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dotenv
import React, {useState} from 'react';
import {List, StyledList} from 'baseui/dnd-list';
function App() {
const [items, setItems] = useState([
{ label: 'Item 1', type: 'basic'},
{ label: 'Item 2', type: 'custom'}
]);
return <List
items={this.state.items}
@tajo
tajo / debouncing.js
Created June 13, 2018 07:36
Debouncing
// Redux-saga debounce input
import { call, cancel, fork, put, take } from "redux-saga/effects"
import { setSearchResults } from "./actions"
import { api } from "./services"
import { delay } from "./utils"
export default function* searchSaga() {
yield [
// Start a watcher to handle search workflow
fork(watchSearch)
{
"folders":
[
{
"path": "/Users/miksu/Projects/cf-www-next"
}
],
"settings": {
"js_prettier": {
"auto_format_on_save": true,
### Keybase proof
I hereby claim:
* I am tajo on github.
* I am miksu (https://keybase.io/miksu) on keybase.
* I have a public key whose fingerprint is 41D8 8B66 035C 0F06 4228 70F7 B258 E84B 3194 642E
To claim this, I am signing this object:
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
if (!Array.prototype.includes) {
Object.defineProperty(Array.prototype, 'includes', {
value: function(searchElement, fromIndex) {
// 1. Let O be ? ToObject(this value).
if (this == null) {
throw new TypeError('"this" is null or not defined');
}
const prettier = require('prettier');
const glob = require('glob');
const fs = require('fs');
// check if the glob was passed (user wants to run it only for a subset of files)
const args = process.argv.slice(2);
console.log(args[0]);
const files = glob.sync(args[0] ? args[0] : '**/*.js', {
ignore: [
#!/usr/bin/python
import sys
import time
import binascii
from des_wrapper import des_decrypt
_pythonMajorVersion = sys.version_info[0]
def bitfield(n):
bits = [int(digit) for digit in bin(n)[2:]]
#!/usr/bin/python
import binascii
import sys
import time
import base64
from des import *
_pythonMajorVersion = sys.version_info[0]
def xor_bits(list1, list2):
res = []