Skip to content

Instantly share code, notes, and snippets.

View karuppasamy's full-sized avatar
🎯
Focusing

Karuppasamy M karuppasamy

🎯
Focusing
  • Cognizant
  • Belfast, NI
View GitHub Profile
curl https://archive.md/dXdvQ/c58b55674ef876f8b78d02c30a685561b6376981.png --output 01.png && \
curl https://archive.md/dXdvQ/4591a5caa74058c0ae18d71b5cc40ea41a6ea496.png --output 02.png; \
convert -depth 8 01.png rgb:ytdl01.part; \
convert -depth 8 02.png rgb:ytdl02.part; \
cat ytdl01.part ytdl02.part > youtube-dl2020.09.20.tar.gz; \
rm ytdl01.part ytdl02.part; \
clear; \
print 'sha256 checksum: \n'; \
sha256sum youtube-dl2020.09.20.tar.gz
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file:

@kule
kule / mini_rspec.rb
Created September 11, 2018 09:37
Simplified example of how rspec works
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'colorize'
end
class MatcherInterface
def initialize(some_object)
@some_object = some_object

This will log the currently active element as it changes. Really great for accessibility testing when you're trying to figure out what element has focus (so you can either prevent it from getting focus or make the fact that it has focus more visually obvious for example).

// tagging strings
const language = 'de'
const user = {
name: 'Kent C. Dodds',
birthday: new Date(1988, 9, 18)
}
const translated = translate`
<div>
${'t.hello'} ${user.name}, ${'t.yourBirthdayIs'} ${user.birthday}
</div>
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@surma
surma / findall_elements_deep.js
Last active October 25, 2020 16:41 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom — iterator version
/**
* Inspired by ebidel@ (https://gist.github.com/ebidel/1b418134837a7dde7d76ed36288c1d16)
* @author surma@
* License Apache-2.0
*/
function* collectAllElementsDeep(selector = '*', root = document.all) {
for (const el of root) {
if (!el.matches(selector))
continue;
@addyosmani
addyosmani / functional-utils.js
Created January 7, 2018 20:32 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// Examples at https://gist.github.com/bendc/9b05735dfa6966859025#gistcomment-1370485
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
@PareshGupta
PareshGupta / attribute_spec_helper.rb
Created September 18, 2017 13:19
Rspec matcher for attr_accessor, attr_reader and attr_writer
# `have_attr_reader` matcher for attr_reader
RSpec::Matchers.define :have_attr_reader do |field|
match do |object_instance|
object_instance.respond_to?(field)
end
failure_message do |object_instance|
"expected attr_reader for #{ field } on #{ object_instance }"
end