Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
@cairey
cairey / unfollow.js
Created February 7, 2016 10:47
Unfollow people that do not follow you on Twitter
/* Scroll to the bottom of https://twitter.com/following
Open the Console and run the following
*/
$('.ProfileCard-content').each(function(){var status = $(this).find('.FollowStatus').text();var unfollowButton = $(this).find('.user-actions-follow-button');if(status != 'follows you'){unfollowButton.click();}});
@dsernst
dsernst / comparing-git-add-all.md
Last active January 29, 2025 15:16
Compare `git add .` vs `git add -A`

git add . vs git add -A

Both of these will stage all files, including new files (which git commit -a misses) and deleted files.

The difference is that git add -A also stages files in higher directories that still belong to the same git repository. Here's an example:

/my-repo
  .git/
 subfolder/
@techslides
techslides / debug-wordpress-queries.php
Created January 15, 2016 20:02
Debug WP Queries. Include this file in functions.php and then add ?debug=sql to any WP URL
<?php
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' )
define('SAVEQUERIES', true);
if ( !function_exists('dump') ) :
/**
* dump()
*
@bmcbride
bmcbride / google-form-to-github-issue.md
Last active September 11, 2024 08:13
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@jtg567
jtg567 / deploy
Created January 10, 2016 08:10
Update SQLite DB on Openshift (add to deploy action hook script)
cd $OPENSHIFT_DATA_DIR
echo "Comparing/Updating main_post table in db to sync production to local"
./sqldiff db.sqlite3 $OPENSHIFT_REPO_DIR/data/db.sqlite3 --table main_post > update_db.sql
sqlite3 db.sqlite3 < update_db.sql
@fields
fields / session_rename.sh
Created January 5, 2016 19:41
Bash script to rename the current window
#!/bin/bash
echo -n -e "\033]0;$1\007"
@bjoern-r
bjoern-r / calcframes.py
Last active April 20, 2017 20:15
c3voc: calculates inframe and outframe number from corresponding timestamps used by shotcut
import datetime, sys
if len(sys.argv) != 3:
print "usage: ", sys.argv[0], "<in> <out>"
exit()
instr="00:01:57.640"
instr=sys.argv[1]
ints=datetime.datetime.strptime(instr, "%H:%M:%S.%f")
// nav
function nav() {
if ($(window).width() < 788) {
$('.mobile-nav-toggle').on('click', function() {
$('.left').css('display', 'block');
$('.left').css('top', '50%');
});
$('.mobile-nav-toggle').on('click', function() {
$('.left').css('top', '85px');
});
@cldrn
cldrn / portrulescript-xml2json
Created December 18, 2015 14:22
XMLStarlet command to convert Nmap's XML output to JSON. (Works on portrule scripts)
xmlstarlet sel -t -m "//host/ports/port/script" -o "{ip:'" -v "ancestor::host/address[@addrtype='ipv4']/@addr" -o "', hostname:'" -v "concat(ancestor::host/hostnames/hostname/@name,'')" -o "', proto:'" -v "../@protocol" -o "', port:" -v "../@portid" -o ", service:'" -v "../service/@name" -o "', script:'" -v "@id" -o "', script-output:'" -v "@output" -o "'}" -n <XML INPUT FILE>
@originalhat
originalhat / fallacy-central.md
Created November 26, 2015 04:20
Fallacy Central

Hasty generalization

>Hasty generalization is an informal fallacy of faulty generalization by reaching an inductive generalization based on insufficient evidence—essentially making a hasty conclusion without considering all of the variables. In statistics, it may involve basing broad conclusions regarding the statistics of a survey from a small sample group that fails to sufficiently represent an entire population. Its opposite fallacy is called slothful induction, or denying a reasonable conclusion of an inductive argument (e.g. "it was just a coincidence").