Skip to content

Instantly share code, notes, and snippets.

View doersino's full-sized avatar
🐛
Squashing bugs but sparing the cute ones!

Noah Doersing doersino

🐛
Squashing bugs but sparing the cute ones!
View GitHub Profile
@maciakl
maciakl / gndn.cmd
Last active December 14, 2015 21:38
Go Nowhere, Do Nothing script. This script pretends to do work but does absolutely nothing. You do get to watch progress bars though. Also, it shows you how to create and call subroutines with parameters in Windows batchfiles.
@echo off
title GNDN
mode 65,25
color 4F
echo.
echo GNDN SUBSYSTEM RECALIBRATION
echo _________________________________________________________________
echo.
echo Level 1 Diagnostic
anonymous
anonymous / wichmann.py
Created December 16, 2015 15:19
try:
#Wir brauchen aktuelle Versionen von BeautifulSoup und Requests
from bs4 import BeautifulSoup;
import requests
import shutil
# Scrapen wir mal los
n = 24 #Hier wirfst du die Anzahl der Seiten rein, die eine Kategorie hat (siehst du in der Pagination)
#(Mir ist voll und ganz bewusst, dass man dass auch einfach aus der Seite scrapen könnte, aber das
#war zeitlich recht sinnlos)
@ragekit
ragekit / tumblrLikeBackup.rb
Created July 11, 2013 13:38
Easy way to backup your tumblr likes
require "oauth"
require 'json'
require 'uri'
#CONFIG :
oauthConsumer = "consumerkey"
oauthSecret ="consumersecret"
tumblrUsername="mail"
@pheraph
pheraph / backup-uberspace.sh
Last active January 24, 2017 19:21
Eine lokale Sicherung eines oder aller uberspace(s) erstellen
#!/bin/sh
#
# Erstellt eine lokale Sicherung von /home/username, /var/www/virtual/username und der Datenbanken des Benutzers
#
# Voraussetzungen:
# Auf dem lokalen Computer sind die uberspaces in ~/.ssh/config wie folgt konfiguriert:
# Host uberspacename
# HostName sternenkonstellation.uberspace.de
# User uberspacename
#
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@mncaudill
mncaudill / similar.php
Created October 31, 2011 05:33
PHP version of simple image similarity algorithm
<?php
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
$filename = 'image.jpg';
list($width, $height) = getimagesize($filename);
$img = imagecreatefromjpeg($filename);
$new_img = imagecreatetruecolor(8, 8);
@madrobby
madrobby / README.md
Created May 17, 2011 16:34 — forked from 140bytes/LICENSE.txt
Luhn10 algorithm

Implementation of the Luhn 10 algorithm to check validity of credit card numbers. See http://en.wikipedia.org/wiki/Luhn_algorithm for details on the algorithm.

var validCreditCard = function(a,b,c,d,e){for(d=+a[b=a.length-1],e=0;b--;)c=+a[b],d+=++e%2?2*c%10+(c>4):c;return!(d%10)};

validCreditCard('378282246310005'); //=> true
validCreditCard('378282246310006'); //=> false

// some numbers to test with
// 378282246310005 371449635398431 378734493671000
@yoneken
yoneken / remove_CLI_tools.sh
Created August 7, 2012 11:03
Xcode Command Line Tools Uninstaller
# remove_CLI_tools.sh
# written by cocoanetics:http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/
# modified by yoneken
#!/bin/sh
RECEIPT_FILE1=/var/db/receipts/com.apple.pkg.DevSDK.bom
RECEIPT_PLIST1=/var/db/receipts/com.apple.pkg.DevSDK.plist
RECEIPT_FILE2=/var/db/receipts/com.apple.pkg.clang.bom
RECEIPT_PLIST2=/var/db/receipts/com.apple.pkg.clang.plist
@brentsimmons
brentsimmons / gist:5810992
Last active January 3, 2021 02:22
Detect a tap on a URL inside a UITextView. Note: the rs_links method isn't included -- you'll need something that takes text and returns an array of detected links. This gist just demonstrates walking through the UITextView characters.
@implementation UITextView (RSExtras)
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) {
/*[s length] is assumed to be 0 or 1. s may be nil.
Totally not a strict check.*/
if (s == nil || [s length] < 1)
return NO;
// Playground - noun: a place where people can play
import Cocoa
struct Regex {
let pattern: String
let expressionOptions: NSRegularExpressionOptions
let matchingOptions: NSMatchingOptions
init(pattern: String, expressionOptions: NSRegularExpressionOptions, matchingOptions: NSMatchingOptions) {