Skip to content

Instantly share code, notes, and snippets.

@tdukart
tdukart / all_games.json
Created May 26, 2023 14:10 — forked from EthanGould/all_games.json
All Games JSON
{
"sports": {
"nhl": {
"status": "In-Progress",
"homeScore": "12",
"segment_number": "5",
"status_id": "4",
"seconds": "10",
"awayScore": "3",
"homeTeam": "was",
@tdukart
tdukart / show-dfp-order-id.js
Created May 7, 2021 19:14
Shows the order ID for all DFP-served ads.
(() => {
const slots = googletag.pubads().getSlots();
slots.forEach((slot) => {
const domId = slot.getSlotId().getDomId();
const campaignId = slot.getResponseInformation().campaignId;
const element = document.getElementById(domId);
const campaignSpan = document.createElement('span');
campaignSpan.innerHTML = campaignId;
element.parentNode.insertBefore(campaignSpan, element);
})
@tdukart
tdukart / gen.sh
Last active November 2, 2018 21:30
Bulk image generator using ImageMagick.
#!/bin/bash
DATE=`date +%Y%m%d`
mkdir $DATE
for i in {1..10}; do
convert -size 300x200 gradient:red-darkred -draw "gravity center fill white font-size 144 text 0,0 ' ${i} '" $DATE/300x200_$i.jpg
convert -size 700x600 gradient:blue-darkblue -draw "gravity center fill white font-size 288 text 0,0 ' ${i} '" $DATE/700x600_$i.jpg
done
@tdukart
tdukart / kebabCase.js
Last active February 2, 2020 05:53
JavaScript Kebab Case function
/**
* Given a string, converts it to kebab case (lowercase, hyphen-separated). For example,
* "makeFoo" becomes "make-foo", and "a Multi Word string" becomes "a-multi-word-string".
*
* @param {string} string Your input string.
* @returns {string} Kebab-cased string.
*/
function kebabCase(string) {
var result = string;
@tdukart
tdukart / ignore-error.txt
Created August 29, 2016 15:33
Error in hsz/idea-gitignore
update failed for AnAction with ID=Vcs.ShowTabbedFileHistory: @NotNull method mobi/hsz/idea/gitignore/outer/OuterIgnoreLoaderComponent.getOuterFiles must not return null
java.lang.IllegalStateException: @NotNull method mobi/hsz/idea/gitignore/outer/OuterIgnoreLoaderComponent.getOuterFiles must not return null
at mobi.hsz.idea.gitignore.outer.OuterIgnoreLoaderComponent.getOuterFiles(OuterIgnoreLoaderComponent.java:124)
at mobi.hsz.idea.gitignore.lang.IgnoreLanguage.getOuterFiles(IgnoreLanguage.java:206)
at mobi.hsz.idea.gitignore.psi.IgnoreFile.isOuter(IgnoreFile.java:154)
at mobi.hsz.idea.gitignore.util.CacheMap.isFileIgnored(CacheMap.java:182)
at mobi.hsz.idea.gitignore.IgnoreManager.isFileIgnored(IgnoreManager.java:315)
at mobi.hsz.idea.gitignore.vcs.IgnoreFileStatusProvider.getFileStatus(IgnoreFileStatusProvider.java:69)
at com.intellij.openapi.vcs.impl.FileStatusManagerImpl.calcStatus(FileStatusManagerImpl.java:141)
at com.intellij.openapi.vcs.impl.FileStatusManagerImpl.getStatus(FileStatusManager
@tdukart
tdukart / keybase.md
Last active August 16, 2016 03:39
Keybase Proof

Keybase proof

I hereby claim:

  • I am tdukart on github.
  • I am tdukart (https://keybase.io/tdukart) on keybase.
  • I have a public key ASAzdo5E3uPtQTuqwrzR9jK9svYgkCboE7yzN-cnSiVXIwo

To claim this, I am signing this object: