Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
@blackfalcon
blackfalcon / cliHacks-bash-git.md
Last active December 25, 2022 17:46
CLI hacks with BASH (and some GiT too)

As professionals we look to always optimize our workload. Through better processes and shortcuts we can eliminate unnecessarily repetitive tasks. One of the tools I use quite often is the Command Line Interface (CLI) and Git, and this is an area that we can automate quite extensively through some really simple to learn BASH hacks.

We all have tasks that we do endlessly, and there are tasks that we do independently and don't realize that there is a definitive pattern that we can embrace, put them to use in a simpler function and alter the results on a per use basis. It is through years of doing things the hard way that I have found some simple tricks that makes my life much easier to maintain.

What is BASH anyway?

Let's get this out of the way quickly first. In short, it is a Unix shell and command language most common on Linux and macOS and recently has made it's way to Windows as well. It is the common interface for running simple commands or other applications such as GiT, Curl, Ack, etc ...

If you

@dsernst
dsernst / Secure Internet Voting.md
Last active August 2, 2022 09:40
Secure internet voting

Proof-of-Vote: A Simple Cryptosystem for Secure Internet Voting

by David Ernst, www.liquid.us

A method to democratically vote online, that provably ensures to the individual voter that their vote was cast and counted correctly, without tampering, while still protecting their vote privacy.

Note: This is designed for our issue-based liquid democracy platform, not traditional elections.

Goals:

@janikvonrotz
janikvonrotz / Create-IndexJsForNodeProjects.ps1
Last active June 29, 2017 17:22
Create index.js for node.js project #PowerShell #Node.js
$import = ""
$export = @()
Get-ChildItem | Where-Object{!@("store", "index").contains($_.BaseName)} | ForEach-Object{
$import += "import $($_.baseName) from '$($_.baseName)';`n"
$export += $_.BaseName
}
@"
<cool>
<p>Hi { message() }</p>
<script>
message() {
return 'there'
}
</script>
<style type="postcss" scoped>
@kdzwinel
kdzwinel / concentrate.js
Last active February 11, 2020 17:29
DevTools snippet that lets you focus on a single element during developement
(function() {
function hideEvertyhingAround($el) {
const $parent = $el.parentElement;
$parent.style.transition = 'background-color 150ms ease-in';
$parent.style.backgroundColor = 'white';
$parent.childNodes.forEach($child => {
if($child !== $el && $child.style) {
@nolanlawson
nolanlawson / parens-and-perf-counterpost.md
Last active August 14, 2023 20:08
"Parens and Performance" – counterpost

"Parens and Performance" – counterpost

Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).

Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.

@cube-drone
cube-drone / 30hax.md
Last active June 8, 2017 09:15
30 Years, 30 Programming Tips

I just made the terrible mistake of turning thirty. Apparently, one of the things that 30-year olds do on YouTube is make lists of 30- things. 30 is a lot of things to put in a list. I tried to make a list of 30 things about being 30, but I got like, four things in before I realized that I didn't have that many things.

So instead, I thought I'd make a list of 30 things I've learned about programming. Let's begin.

  1. this first episode has Q in it? Like, first episode. ugh, this is not off to a strong start.
  2. why does everybody hate Wesley Crusher so much? He doesn't seem so bad, and Wil Wheaton is a really nice guy in real life.
  3. oh. OH. I get it now. I understand the hate.

Oh. Sorry, that's a list I'm making about watching Star Trek The Next Generation for the first time. I'll .. uh... get to that later.

@dsernst
dsernst / visualize_complex_linked_list.md
Created September 13, 2016 09:51
How to arrange a complex linked list? For visualizing Liquid Democracy

How to arrange a complex linked list?

Given a singly linked list like this:

[
  {
    uid: 'a',
    full_name: 'Angela Augustine',
 next: 'c',
@originalhat
originalhat / branch-diff.md
Created September 6, 2016 22:31
diff two branches SUH PRUTTY
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..branch-X
@Barlog951
Barlog951 / utf_convert
Last active September 22, 2016 16:20
Automated subtitles convert to UTF-8
#!/bin/bash
LANGUAGE=czech
TO=utf8
CONVERT="enca -L $LANGUAGE -x $TO"
# Find and onvert
find ./ -type f -name "*.srt" | while read fn; do
IS_TARGET=`enca "${fn}" | egrep -ow -m 1 'UTF-8|Unrecognized|KOI8-CS2|7bit ASCII|UCS-2|Macintosh Central European'`
if [ "$IS_TARGET" != "UTF-8" ] &&