Skip to content

Instantly share code, notes, and snippets.

View timurista's full-sized avatar
👋

Tim Urista timurista

👋
View GitHub Profile
My Class {
public static void main(String[] args) {
System.out.println("main");
}
}
@timurista
timurista / find-console.sh
Last active February 15, 2018 15:48
Bash script for finding console logs in your branch
# grabs files between develop / master and head
files=`git diff --name-only develop..HEAD -- "*.js"`
# Save current IFS
SAVEIFS=$IFS
# Change IFS to new line.
IFS=$'\n'
names=($files)
# Restore IFS
IFS=$SAVEIFS
@timurista
timurista / prefix-commit-name.sh
Created February 15, 2018 15:50
grabs ticket and jira name
s=`git rev-parse --abbrev-ref HEAD | awk '{print toupper($0)}'`
JIRA_TYPE=` echo $s | rev | cut -d'-' -f2 | rev`
TICKET=`echo $s | rev | cut -d'-' -f1 | rev`
# call git with the message
echo [$JIRA_TYPE-$TICKET] $@
# git cmp = "!f() { git add -A && git commit -m \"$@\" && git push; }; f"
git cmp "[$JIRA_TYPE-$TICKET] $@"
@timurista
timurista / .gitconfig
Created February 15, 2018 15:54
some default settings for the gitconfig
[core]
editor = code --wait
[alias]
# one-line log
lg = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
dl = branch -D
dlremote = "!f() { git branch -D \"$@\" && git push origin --delete \"$@\"; }; f"
co = checkout
st = status -s
newbranch = "!f() { git checkout -b $@ && git push -u origin $@; }; f"
@timurista
timurista / config-editor.md
Created March 19, 2018 02:01 — forked from nnja/config-editor.md
Configure git editor

Set which editor git should use.

This is the program that will open during a commit with no -m flag, a merge, a rebase, etc...

Select from any installed editor. Examples:

  • emacs: emacs
  • vi: vi or vim
export const InvisibleInput = styled.input`
opacity: 0;
position: absolute;
cursor: pointer;
&:focus + ${RadioButton} {
box-shadow: 0 0 0 2px ${theme.colors.white},
0px 0px 0px 4px ${tint(0.35, theme.colors.teal)};
}
`;
@timurista
timurista / branch-commit-pr.fish
Created November 2, 2018 13:35
branch-commit-pr.fish for fast saving
#!/bin/fish
# echo $argv[1]
set name $argv[1]
set branch_name (string replace -a ' ' '-' $name)
# echo $branch_name
git fetch origin
gnb $branch_name
gp "$name"
pr
@timurista
timurista / deduper-using-sha.js
Last active January 2, 2019 23:58
Dedupe news api data using sha256
(function () {
'use strict';
var ERROR = 'input is invalid type';
var WINDOW = typeof window === 'object';
var root = WINDOW ? window : {};
if (root.JS_SHA256_NO_WINDOW) {
WINDOW = false;
}
var WEB_WORKER = !WINDOW && typeof self === 'object';
@timurista
timurista / remove-dupes-using-symbols.js
Last active January 11, 2019 14:26
Remove dupes using es6 symbols
let testNews = [{...}];
function filterDupes(y) {
y = y.map(x => {
const combined = x.title+x.description;
const id = Symbol.for(combined.replace(/[^\w]+/g, ''))
return {...x, id}
})
var seen = {};
@timurista
timurista / countrycode-latlong-array.json
Created January 13, 2019 22:54 — forked from sindresorhus/countrycode-latlong-array.json
Country codes (ISO 3166) to latitude longitude - converted from http://www.maxmind.com/app/country_latlon
{
"ad": [
"42.5000",
"1.5000"
],
"ae": [
"24.0000",
"54.0000"
],
"af": [