Skip to content

Instantly share code, notes, and snippets.

View DarrenCattle's full-sized avatar

Darren Cattle DarrenCattle

View GitHub Profile
@DarrenCattle
DarrenCattle / file-organizer.py
Last active May 28, 2017 02:52
script that will rename your files based on when they were created
# File Organizer
# Darren Cattle
# May 2017
# Python3
import os
import datetime
import calendar
def conv_unix(timestamp):
return datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %Hh%Mm%Ss')
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
var msgbox = $('#message-input')[0];
var delay = 4000;
for(var a = 0; a < 1000; a++) {
setTimeout(
(function(a) {
return function() {
msgbox.value = a%2 == 0 ? "darren++" : "d++";
@DarrenCattle
DarrenCattle / slack21
Created February 7, 2015 17:51
Slack POSTHTTP
var url = "https://hooks.slack.com/services/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";
var method = "POST";
var postData = '{"channel": "#random", "username": "21daybot", "text": "Congrats to Darren for writing'+Math.random()*100+'lines of code today!", "icon_emoji": ":ballot_box_with_check: "}';
var async = true;
var request = new XMLHttpRequest();
request.onload = function () {
var status = request.status; // HTTP response status, e.g., 200 for "200 OK"
var data = request.responseText; // Returned data, e.g., an HTML document.
};
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var square = (function () {
var sp = {};
sp.draw = function() {
console.log('hi dcat');
var a = 0;
var d = document.getElementById("placebut"),
interval = setInterval(function(){
a++;
console.log("Clicking:", a);
d.click();
}, 1000);
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var spiral = (function () {
var sp = {};
sp.draw = function() {
console.log('hi dcat');
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var delay = 500;
var i = 0; var x = 0; var h = 0;
for(i = 0; i < 32; i++) {
for(x = 0; x < 32; x++) {
setTimeout(
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var delay = 500;
var i = 0; var d = 0;
var x = 0; var y = 0;
var x1 = 0; var y1 = 0;
for(i = 0; i < 400; i++) {
var ping = require('jjg-ping');
function pingGoogle () {
var connected, disconnected, c, d = 0;
var spikelength, spikedistance = [];
this.run = function() {
ping.system.ping('google.com', function(latency, status) {
if (status) {