Skip to content

Instantly share code, notes, and snippets.

View Strajk's full-sized avatar
🐣
knock knock…

Pavel 'Strajk' Dolecek Strajk

🐣
knock knock…
View GitHub Profile
@bezhermoso
bezhermoso / notification-actions.applescript
Last active February 11, 2023 09:54
Handly AppleScripts to manage OS X notifications. (Use in Automator, bind to keyboard shortcuts via BetterTouchTool, etc.) Inspired by http://apple.stackexchange.com/a/155736
# Close all notifications
my closeNotifications()
on closeNotifications()
tell application "System Events" to tell process "Notification Center"
set theWindows to every window
repeat with i from 1 to number of items in theWindows
set this_item to item i of theWindows
try
click button 1 of this_item
@sibelius
sibelius / Codemod RN24 to RN25.md
Last active November 9, 2016 13:09
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
@froots
froots / Car.js
Last active June 6, 2018 23:27
Stubbing module dependencies in ES2015 unit tests using Sinon.js or TestDouble.js.
// in /src directory
import {kphToMph} from './convert';
class Car {
constructor(speed) {
this.speed = speed;
}
getSpeedInMph() {
@brenopolanski
brenopolanski / npm-list-globally.md
Created November 1, 2016 19:34
Listing globally installed NPM packages and version
npm list -g --depth=0
@btnwtn
btnwtn / 50.js
Last active September 18, 2019 16:09
Automat dat +50 clapping on Medium.com
(() => {
const up$ = new MouseEvent("mouseup", { bubbles: true });
const down$ = new MouseEvent("mousedown", { bubbles: true });
const node = document.querySelector(
`.js-postActionsFooter button[data-action="multivote"]`
);
let attempts = 0;
@inorganik
inorganik / thunderclap.js
Last active March 31, 2021 08:50
Smash Medium's clap button the max number of times (50) in 1 second
// smash Medium's clap button the max number of times
function simulateClick(node) {
var md = document.createEvent('MouseEvents');
md.initEvent('mousedown', true, false);
node.dispatchEvent(md);
var mu = document.createEvent('MouseEvents');
mu.initEvent('mouseup', true, false);
node.dispatchEvent(mu);
}
@yyuu
yyuu / circle.rb
Last active December 7, 2019 13:10
A simple script to convert Circle CI configurations from circle.yml (1.0) to .circleci/config.yml (2.0)
#!/usr/bin/env ruby
require "fileutils"
require "shellwords"
require "yaml"
CIRCLE1_DEFAULT_CACHE_DIRECTORIES = [
"vendor/bundle",
"~/.m2",
"~/.bundle",
@martin-kokos
martin-kokos / Webexpo 2019.md
Last active June 24, 2021 15:37
Webexpo 2019
@kaushikgopal
kaushikgopal / karabiner.edn
Last active May 16, 2024 00:57
My source Karabiner file in Goku's edn format - Now lives @ https://github.com/kaushikgopal/dotfiles/blob/master/.karabiner.edn
;; File has moved over to https://github.com/kaushikgopal/dotfiles/blob/master/.karabiner.edn
;; Feel free to raise github issues in that repo, if you have questions/comments/edits
@Dainius14
Dainius14 / og-developer-sound-pack.user.js
Last active March 5, 2024 08:54
OG Developer Sound Pack
// ==UserScript==
// @name OG Developer Sound Pack
// @namespace https://saldainius.lt
// @downloadUrl https://gist.github.com/Dainius14/8a9d5bfa06458a93a00b8d34111e7e4f/raw/og-developer-sound-pack.user.js
// @updateUrl https://gist.github.com/Dainius14/8a9d5bfa06458a93a00b8d34111e7e4f/raw/og-developer-sound-pack.user.js
// @website https://gist.github.com/Dainius14/8a9d5bfa06458a93a00b8d34111e7e4f/
// @version 1.5.2
// @description Plays sound when interacting with Bitbucket and Jira
// @author Dainius
// @match https://bitbucket.cid-dev.net/projects/*/repos/*/pull-requests/*