recentpopularlog in

kme : devel   1367

« earlier  
Git Aliases I Use (Because I'm Lazy) - victorzhou.com
[alias]
s = status
d = diff
co = checkout
br = branch
last = log -1 HEAD
cane = commit --amend --no-edit
lo = log --oneline -n 10
pr = pull --rebase
git  alias  shortcuts  productivity  commandline  devel 
11 days ago by kme
Kernighan's lever
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?


Pay close attention to what is actually being said: Having written code as cleverly as you can, you will suddenly face a problem that you are not clever enough to solve.

Kernighan's witty remarks provide a clue: In programming, as soon as you work at your current level, you will automatically end up in a situation where you have to work beyond your current level. By means of this very fortunate mechanism, you will leverage several basic human drives (honour, pride, stubbornness, curiosity) into providing the motivation necessary for improvement.

I call this mechanism Kernighan's lever. By putting in a small amount of motivation towards the short-term goal of implementing some functionality, you suddenly end up with a much larger amount of motivation towards a long term investment in your own personal growth as a programmer.
devel  software  debugging  advice  career  growth  kernighan 
24 days ago by kme
brammool/libvterm: Mirror of http://bazaar.leonerd.org.uk/c/libvterm/
<code>To merge in changes from Github, do this:
- Commit any pending changes.
- Setup the merge tool:
git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false
- Run the merge tool:
git mergetool
This will open a four-way diff between:
LOCAL - your current version
BASE - version as it was at your last sync
REMOTE - version at head on Github
MERGED - best-effort merge of LOCAL and REMOTE
Now find places where automatic merge didn't work, they are marked with
<<<<<<<<, ======= and >>>>>>>
Fix those places in MERGED, remove the markers, and save the file :wqall.</code>
vim  devel  git  vimdiff  merging  merge  mergetool  tipsandtricks 
4 weeks ago by kme
What is the !! (not not) operator in JavaScript? - Stack Overflow
An easy way to describe it is: Boolean(5) === !!5; Same casting, fewer characters
devel  javascript  boolean  idiom  syntax  newbie  dammitbrain 
4 weeks ago by kme
Spotlight Metadata Attributes
You can use these with 'mdfind', e.g., 'kMDItemKind == "Application"'.
mdfind  metadata  spotlight  macos  osx  devel  reference 
5 weeks ago by kme
List commits between 2 commit hashes in git - Stack Overflow
I ended up using
<code class="language-bash">git log -L 150,180:builtins/shopt.def bash-4.1.11..bash-4.3</code>
to solve the problem I was having (which version of Bash introduced the 'direxpand' option to 'shopt'; hint: 4.2.29)

See also: https://unix.stackexchange.com/q/498857/278323
devel  git  commit  history  automation  forensics  sortof  solution 
8 weeks ago by kme
UTF8, MySQL, Perl and PHP (Phil Gyford: Writing)
Only these two together seemed to work for me (CentOS 7, using vendor-supplied perl-DBD-MySQL-4.023-6.el7.x86_64):

<code class="language-perl">$dbh->{'mysql_enable_utf8'} = 1;
$dbh->do('SET NAMES utf8');</code>

The error message I would get otherwise was
SQL execution failed: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1' (1253)


Even if the table, server, column, collation were all 'utf8'. The *client* was the missing part, and 'SET NAMES utf8' fixes that, seemingly.
perl  dbd  dbi  database  errormessage  devel  solution 
8 weeks ago by kme
DBD::mysql - MySQL driver for the Perl5 Database Interface (DBI) - metacpan.org
Additionally, turning on this flag tells MySQL that incoming data should be treated as UTF-8. This will only take effect if used as part of the call to connect(). If you turn the flag on after connecting, you will need to issue the command SET NAMES utf8 to get the same effect.


This did *not* work as advertised, and I ended up setting it *after* the connect, along with 'SET NAMES', which actually *did* seem to fix the error messages I was getting about "COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1'":

<code class="language-perl"># source https://www.gyford.com/phil/writing/2008/04/25/utf8-mysql-perl/
# see also: https://stackoverflow.com/a/6423280/785213
$dbh->{mysql_enable_utf8} = 1;
# $dbh->do('SET NAMES utf8');</code>
perl  dbi  dbd  mysql  dba  devel  reference  errormessage  workaround  solution 
8 weeks ago by kme
Sorting strings properly is stupidly hard – Daniel Lemire's blog
However, I tried to test out the sorting on fr_ca locale and got the incorrect answer, which I found out was due to incorrect locale settings on Max OS X/BSD. On my machine, fr_FR.UTF-8 collation is linked to la_LN.US-ASCII
sorting  ishard  collation  strings  devel  javascript  python  pitfalls  macos  elcapitan  brokenness 
july 2019 by kme
[dev] Re: Auto-preview man pages from Charles Lehner on 2016-01-09 (dev mail list archive)
You could also send mupdf a SIGHUP signal to tell it to reload, instead of spawning a new mupdf:
<code class="language-bash">
mupdf address.pdf & pid="$!"
echo address.yaml | entr sh -c "make address.pdf && kill -HUP $pid"</code>
entr  automation  manpage  commandline  devel  tipsandtricks 
july 2019 by kme
Working on CityDesk, Part Five – Joel on Software
4. If You Can Only Do One Platform, Do Windows.

I’d love to have a Mac version and a Linux version, but they are not good uses of limited resources. Every dollar I invest in CityDesk Windows will earn me 20 times as many sales as a dollar invested in a hypothetical Mac version. Even if you assume that Mac has a higher percentage of creative and home users, I’m still going to sell a heck of a lot more copies on Windows than I could on Mac. And that means that to do a Mac version, the cost had better be under 10% of the cost of a Windows version. Unfortunately, that’s nowhere near true for CityDesk. We benefit from using libraries that are freely available on Windows (like the Jet multiuser ACID database engine and the DHTML edit control) for which there are no equivalents on the Macintosh. So if anything, a Mac port would cost more than the original Windows version. Until somebody does something about this fundamental economic truth, it’s hard to justify Mac versions from a business perspective. (Incidentally, I have said time and time again, if Apple wants to save the Mac, they have to change this equation.)

And don’t get me started about Linux. I don’t know of anyone making money off of Linux desktop software, and without making money, I can’t pay programmers and rent and buy computers and T1s. Despite romantic rhetoric, I really do need to pay the rent, so for now, you’re going to have to rely on college kids and the occasional charitable big company for your Linux software.
devel  gui  webui  webapps  windows  perspective  mac  crossplatform  economics 
july 2019 by kme
aanand/git-up: NOT MAINTAINED
git pull has two problems:

* It merges upstream changes by default, when it's really more polite to rebase over them, unless your collaborators enjoy a commit graph that looks like bedhead.

* It only updates the branch you're currently on, which means git push will shout at you for being behind on branches you don't particularly care about right now.
git  helperscript  devel  workflow  ruby  rubygem 
june 2019 by kme
git_semver · PyPI
Simple usage
<code class="language-bash">git semver
# 0.1.0

git semver --next-patch
# 0.1.1

git semver --next-minor
# 0.2.0

git semver --next-major
#1.0.0</code>
devel  git  semver  versioning  packaging  release  utility  python  helperscript 
june 2019 by kme
BubbleSort Zines
Zines about computer science! Each zine focuses on one concept & is filled with comics, diagrams, stories, examples, and exercises.
cs  code  art  devel  programming  reference  newbie  zine 
june 2019 by kme
Deciphering Glyph :: Software You Can Use
The worse news is that every day we don’t have this, more and more people are re-writing their user-facing tools and applications in JavaScript or Go or Swift or Java, to suit their target platform, because it is honestly easier to learn an entirely new programming language and toolchain, and rewrite an entire application than to figure out how to build a self-contained executable in Python right now.
python  sorrystateof  desktop  devel  packaging 
june 2019 by kme
GAMES MADE QUICK??? 2.0 - itch.io
A game jam from 2018-01-07 to 2018-01-15 hosted by eevee. >>> ✨ 🚨 Discord ✨ 🚨 <<< Hey, you. Yeah, you. I see you there. Settling down with your popcorn and snacks. "I won't watch GDQ all week,&q
python  pygame  gaming  devel  programming 
june 2019 by kme
The End Of Object Inheritance & The Beginning Of A New Modularity - YouTube
1. use types for nouns
2. express code relationships structurally
3. most programming is parametric ("partial") programming

Advice:
* make illegal states unrepresentable (Yaron Minsky)
* ==> make illegal behavioral interactions impossible
devel  design  programming  oop  inheritance  composition  video  python  modularity 
june 2019 by kme
Simple Gtk3 Webkit Example (Vala) | https://gist.github.com/
Simple Gtk3 Webkit Example (Vala). GitHub Gist: instantly share code, notes, and snippets.
webkitgtk  webkit  vala  devel  samplecode 
may 2019 by kme
NASA-SW-VnV/ikos: Static analyzer for C/C++ based on the theory of Abstract Interpretation.
Static analyzer for C/C++ based on the theory of Abstract Interpretation. - NASA-SW-VnV/ikos
c  cplusplus  staticanalyzer  devel 
may 2019 by kme
Merge requests | GitLab
Interesting tip on how to make an alias accept arguments:
<code class="language-bash">[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
</code>
git  gitlab  versioncontrol  scm  vcs  mergerequest  merging  devel  reference 
april 2019 by kme
Java Future Release Notices | https://www.java.com/
Good job, Larry Ellison. Now everyone will be running insecure versions of Java forever, and you just wrote Java's death warrant in the process.
oracle  java  jdk  devel  licensing  updates 
march 2019 by kme
git - .gitignore exclude folder but include specific subfolder - Stack Overflow | https://stackoverflow.com/
To do what you want, you have to “unignore” every parent directory of anything that you want to “unignore”. Usually you end up writing rules for this situation in pairs: ignore everything in a directory, but not some certain subdirectory.
<code class="language-gitignore"># you can skip this first one if it is not already excluded by prior patterns
!application/

application/*
!application/language/

application/language/*
!application/language/gr/</code>
git  gitignore  devel  annoyance  dammitbrain  solution 
march 2019 by kme
makefile - Joining elements of a list in GNU Make - Stack Overflow | https://stackoverflow.com/

You can use the $(subst) command, combined with a little trick to get a variable that has a value of a single space:
<code class="language-makefile">
p = /usr /usr/share /lib
noop=
space = $(noop) $(noop)

all:
@echo $(subst $(space),:,$(p))
</code>
devel  make  makefile  pathvariable  pathlikevariable  textprocessing  solution 
february 2019 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read