This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2021 Soumya Deb <debloper@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's initialize the primitives | |
var startTime, endTime, fileSize; | |
// Set up the AJAX to perform | |
var xhr = new XMLHttpRequest(); | |
// Rig the call-back... THE important part | |
xhr.onreadystatechange = function () { | |
// we only need to know when the request has completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service mysql stop | |
mysqld_safe --skip-grant-tables | |
mysql --user=root mysql |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generic syntax | |
ffmpeg -i in.mp4 -filter:v "crop=outW:outH:cropX:cropY" -c:a copy out.mp4 | |
# Center-crop an HD video from UHD video | |
ffmpeg -i in.mp4 -filter:v "crop=1920:1080:960:540" -c:a copy out.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>TRex - Let's Back Tweets Up</title> | |
<style> | |
body { background: #eee; } | |
form { | |
width: 640px; margin: auto; padding: 24px; display: table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Replace <DB> with actual DB name | |
$db = new PDO("sqlite:/path/to/<DB>.sqlite") or die("cannot open the database"); | |
// The WHERE clause excludes internal users; feel free to filter it any way you want | |
$query = $db->query("SELECT * FROM user WHERE user_email <> '';"); | |
// Get the column names; unfortunately this is the simplest way | |
$meta = ""; | |
for ($i=0; $i<=7; $i++) { $meta = $meta . "\n" . $query->getColumnMeta($i)["name"]; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require("net") | |
, dns = require("dns") | |
, exp = require("express") | |
, app = exp(); | |
app.configure(function() { | |
app.use(exp.logger()); | |
app.use(app.router); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remap $ to jQuery object | |
var $ = jQuery; | |
// The real fun begins... first catch all the post-anchors & loop on them | |
$(document).on("scroll", function () { | |
// Let's declare some reusable globals for the next iterations | |
var urlBase = "http://img-9gag-lol.9cache.com/photo/"; | |
$(".badge-evt.badge-nsfw-entry-cover").each(function () { | |
// Remove the NSFW class, to avoid redundant processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cqlsh | |
Connected to Test Cluster at 127.0.0.1:9042. | |
[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4] | |
Use HELP for help. | |
cqlsh> CREATE KEYSPACE foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; | |
cqlsh> USE foo; | |
cqlsh:foo> CREATE TABLE foo.bar (id int PRIMARY KEY, status text, details list<text>); | |
cqlsh:foo> INSERT INTO bar (id, status, details) VALUES (1, 'done', ['sample text']); |
NewerOlder