Skip to content

Instantly share code, notes, and snippets.

# http://stackoverflow.com/questions/4673391/why-doesnt-haml-check-find-this-glaring-syntax-error
haml -c newsletter.html.haml
haml --debug newsletter.html.haml 2> /dev/null | sed '$d' | ruby -c
@kevinhq
kevinhq / delete-likes-from-twitter.md
Created January 31, 2021 06:36 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@kevinhq
kevinhq / clean.sh
Created May 26, 2020 09:22 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@kevinhq
kevinhq / README.md
Created April 25, 2020 11:20 — forked from soxofaan/README.md
Simple pretty CSV and TSV file viewer.
@kevinhq
kevinhq / migrate_paperclip_to_s3.rake
Created April 21, 2020 11:36 — forked from awd/migrate_paperclip_to_s3.rake
Migrate local paperclip assets to Amazon S3.
##
# Use this behind the scenes to migrate files from your filesystem to Amazon S3
# %: rake paperclip_migration:migrate_to_s3
##
namespace :attachments do
desc "migrate files from filesystem to s3"
task :migrate_to_s3 => :environment do
require 'aws/s3'
@kevinhq
kevinhq / migrate_paperclip_to_s3.rake
Created April 21, 2020 11:35 — forked from awd/migrate_paperclip_to_s3.rake
Migrate local paperclip assets to Amazon S3.
##
# Use this behind the scenes to migrate files from your filesystem to Amazon S3
# %: rake paperclip_migration:migrate_to_s3
##
namespace :attachments do
desc "migrate files from filesystem to s3"
task :migrate_to_s3 => :environment do
require 'aws/s3'
@kevinhq
kevinhq / minimal-analytics-snippet.js
Created December 21, 2018 09:29 — forked from DavidKuennen/minimal-analytics-snippet.js
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {