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
def createSlug(title) | |
maxlength = 35 | |
title = title.gsub(' ', '-').gsub(/[^\w-]/, '').gsub(/(-){2,}/, '-').downcase | |
return title[0, title.length > maxlength ? (title[0, maxlength].rindex('-') or maxlength) : maxlength] | |
end |
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
.py global t; t='YOUR TEXT HERE'; print ''.join('' + str(divmod(n,14)[1]+1) + t[n] for n in range(0,len(t))) |
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
<!-- this good thing was written by Cazum (zombiearmy.net) in April, 2015. released under the WTFPL.--> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1"> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
.grid { |
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
follow this guide for statically linked library compilation: | |
http://www.adp-gmbh.ch/cpp/gcc/create_lib.html | |
on the final step where you compile main.c, add "-lws2_32" to the end of the line. | |
so, "gcc -static main.c -L. -lmongoose -o output -lws2_32" |
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
/* Will display mobile version on browsers that don't support media queries (<= IE8, feature phones, etc)*/ | |
/* This may be possible to reduce further, as there are three .column instances, and there may be redundant properties */ | |
.grid { | |
width:100%; | |
padding: 0 32px; | |
max-width:960px; | |
margin: 0 auto; | |
box-sizing: border-box; | |
} | |
.row:after{ |
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
#include <stdio.h> | |
#include <sys/stat.h> | |
#include <stdlib.h> | |
#include "curl/curl.h" | |
#include <string.h> | |
/* Use libcurl-openssl-dev | |
* in geany, only use f9 to compile the project and f5 to run it. the buttons at the top dont do the same thing. | |
* Next, -l flags should be added to the end of the 'build' command. Not compile | |
* yes, I'm new to C :) |
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
static unsigned char alphanum[37] = {0xEE, 0x3E, 0x9C, 0x7A, 0x9E, 0x8E, 0xBC, 0x6E, 0x0C, 0x78, 0xAE, 0x1C, 0xA8, 0xEC, 0xFC, 0xCE, 0xE6, 0xCC, 0xB6, 0x1E, 0x7C, 0x74, 0x54, 0x6E, 0x76, 0xD2, 0xFC, 0x60, 0xDA, 0xF2, 0x66, 0xB6, 0xBE, 0xE0, 0xFE, 0xF6, 0x00}; | |
int pin_offset = 2; //the pin your 7seg starts at. | |
//used for cycling through characters | |
int iterator = 200; //just for demonstration purposes. | |
void printCharacter(char c_) { | |
//if the character is a lowercase alpha, convert it to an uppercase. | |
if(c_ >= 97 && c_ <= 122) { | |
c_ -= 32;//lowercase letters appear 32 places higher in the ascii 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
#Plexhometheater closes itself after 30 minutes of inactivty | |
#This script checks to see if plexhometheater is off, and if it is, | |
#checks for any major network traffic (to indicate movie stream, or file xfer) | |
#if no network activity is detected, the computer shuts down. | |
#if network activity IS detected, plexhometheater is started again | |
def plexIsRunning() | |
command = `ps -ef|grep -v grep|grep /opt/plexhometheater/bin/plexhometheater` | |
if command == "" then | |
return false | |
end |
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
function mousePosition(e_) { | |
//accepts a mouseEvent | |
var canvas = document.getElementById("myCanvas"); | |
var canvas_bound_rect = canvas.getBoundingClientRect(); | |
mousex = Math.round(((e_.clientX - canvas_bound_rect.left)/(canvas_bound_rect.right - canvas_bound_rect.left)) * canvas.width); | |
mousey = Math.round(((e_.clientY - canvas_bound_rect.top)/(canvas_bound_rect.bottom - canvas_bound_rect.top)) * canvas.height); | |
return {x : mousex, y : mousey} | |
} |
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
// ==UserScript== | |
// @name Expand All Images | |
// @namespace zombiearmy.expandimage | |
// @description Expand all images in a 4chan thread | |
// @match *://boards.4chan.org/* | |
// @match *://boards.4channel.org/* | |
// @version 2 | |
// @grant none | |
// ==/UserScript== |
OlderNewer