Skip to content

Instantly share code, notes, and snippets.

View paazmaya's full-sized avatar
:shipit:
Finding updates on my releases

Juga Paazmaya paazmaya

:shipit:
Finding updates on my releases
View GitHub Profile
@paazmaya
paazmaya / node-xperia-camera-rename.js
Last active September 10, 2016 22:01
Node.js script for renaming burst images from Xperia Z2 camera, as it has not enough options
/**
* node-xperia-camera-rename.js
* Juga Paazmaya <[email protected]>
*
* Take a folder that originates from Sony Xperia Z2 camera
* and rename the burst images, so that they can exist in a
* same folder.
*
* node node-xperia-camera-rename.js .
*/
@paazmaya
paazmaya / tabs-two-spaces.sh
Created June 17, 2014 12:05
Tabs to two spaces
find . -maxdepth 8 -type f -name '*.haml' -exec sh -c 'expand -t 2 {} > {}.new && mv {}.new {}' ';'
@paazmaya
paazmaya / deleted-videos.sh
Last active August 29, 2015 14:04
List removed video files in Mercurial repository
hg log -r "removes('**')" --template "{rev}:\n{file_dels % '{file}\n'}\n" | grep -e '\.mp4' -e '\.avi' -e '\.mkv' > ../deleted-videos
# hg convert --filemap deleted-videos.map
awk '{print "exclude \"" $0 "\""}' ../deleted-videos > ../deleted-videos.map
@paazmaya
paazmaya / speakerdeck.js
Last active August 29, 2015 14:04
Speakerdeck Chrome snippet for getting data of the current page
// speakerdeck.js
// Get a list of decks on the given page
(function () {
var talks = document.querySelectorAll(".talk.public");
var data = [];
for (var i = 0; i < talks.length; i++) {
var talk = talks[i];
var item = {};
if (talk) {
@paazmaya
paazmaya / get-issue-images.js
Created October 26, 2015 14:12
Download images that are attached in the comments of a specific GitHub issue
/**
* Get the files attached on a GitHub issue and its comments
*
* @see https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue
* @see https://developer.github.com/v3/media/#comment-body-properties
*/
'use strict';
const fs = require('fs');
const got = require('got');
@paazmaya
paazmaya / fix-dates.js
Created November 10, 2015 16:58
Fix unix dates to suitable in frontmatter
/**
* Convert unix timestamps to ISO times in frontmatter
*/
'use strict';
const fs = require('fs'),
path = require('path'),
yfm = require('yaml-front-matter');
@paazmaya
paazmaya / rename-tape-to-test.sh
Created August 8, 2016 08:46
Rename test files to have the word test instead of tape in the end
find . -maxdepth 3 -type f -name '*_tape.js' \
-exec sh -c '(cd $(dirname {}) && pwd && base=$(basename {}) && git mv $base ${base/tape/test} )' ';'
@paazmaya
paazmaya / github-create-labels.sh
Last active October 3, 2017 12:12
Create hacktoberfest label to all GitHub repositories
find . -maxdepth 3 -type d -name '.git' \
-exec sh -c '(cd {}/.. && pwd && echo $(basename $(pwd)) && \
curl -H "Authorization: token $GITHUB_TOKEN" --include --request POST \
--data "{\"name\":\"hacktoberfest\",\"color\":\"ff4499\"}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/paazmaya/$(basename $(pwd))/labels")' ';'
@paazmaya
paazmaya / keybase.md
Created May 15, 2017 13:18
keybase.md

Keybase proof

I hereby claim:

  • I am paazmaya on github.
  • I am paazmaya (https://keybase.io/paazmaya) on keybase.
  • I have a public key whose fingerprint is 66E0 E444 BD89 7C3B EB43 E414 B1B9 8F3F CE10 DC6C

To claim this, I am signing this object:

@paazmaya
paazmaya / npm-git-compare-tags.sh
Created June 28, 2017 08:23
Compare latest git tag against latest npm published version
find . -maxdepth 2 -type d -name '.git' \
-exec sh -c '(cd {}/.. && pwd && git describe --tags && npm info . dist-tags.latest)' ';'