Skip to content

Instantly share code, notes, and snippets.

View glamrock's full-sized avatar
🐝
hacking on things at Berkman <3

Griffin Boyce glamrock

🐝
hacking on things at Berkman <3
View GitHub Profile
def insert_comma(mystring, position):
mystring[:position] + ',' + mystring[position:]
offset = 0
for magic_number in magic_numbers:
position = magic_number + offset
mystring = insert_comma(mystring, position)
offset += 1
@lambdan
lambdan / itsfuckingraw.py
Created August 19, 2018 13:36
extract snippets of video containing a certain phrase for instance
import os, sys, re, subprocess
tsfile = 'raws.txt'
# create the Timestamps (tsfile) using grep and Sublime Text or whatever you want
# it should contain the episode name/video file + the timestamp, for example:
#
# Seinfeld.S03E15.The.Suicide.720p.HULU.WEBRip.AAC2.0.H.264-NTb.srt-00:14:25,242 --> 00:14:27,775
# Seinfeld.S03E17.The.Boyfriend.720p.HULU.WEBRip.AAC2.0.H.264-NTb.srt-00:12:34,738 --> 00:12:36,639
# S03E18-00:12:34,768 --> 00:12:36,639
# ...
@marklit
marklit / install.sh
Last active November 24, 2021 13:26
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
@AKB428
AKB428 / twVideo.json
Created February 7, 2015 18:31
Twitter Video JSON
{
"contributors": null,
"text": "ツイッター動画投稿テスト http://t.co/y9hjEfABw1",
"geo": null,
"retweeted": false,
"in_reply_to_screen_name": null,
"possibly_sensitive": false,
"truncated": false,
"lang": "ja",
"entities": {
@cnicodeme
cnicodeme / cryptocat.js
Last active December 24, 2015 01:39
Switch the Cryptocat discussion page from fixed layout to full width layout :)
// Inject css rules in Cryptocat conversation for a full width display
// Also add a "body click to text focus" action (using jQuery, already embedded in Cryptocat)
// Note: Only tested on IE 6 ! (Ok, I'm kidding, only Chrome)
// Author : Cyril N.
(function (){
var newcss = "#userInput>#userInputText {width : 84%;} body>div#bubble {width : auto; margin : 0 auto; position : absolute; top : 0; bottom : 0; left : 0; right : 0; height : auto; border-radius: 0}";
newcss += "div#conversationWindow .line1, div#conversationWindow .line2, div#conversationWindow .line3, div#conversationWindow .line4 {max-width : 96%;}";
newcss += "div#buddyWrapper {width : 14%;}";
@yanofsky
yanofsky / LICENSE
Last active March 14, 2025 18:19
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
#!/usr/bin/env python
# requires python >= 2.7
# see: https://pypi.python.org/pypi/ordereddict
from collections import OrderedDict
MAXLRU = 200
class LRU(OrderedDict):
def __init__(self, *args, **kwds):
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 19, 2025 17:31 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@rsvp
rsvp / digy.sh
Created February 14, 2012 06:26
digy.sh : tame DNS utility dig with reasonable options. Linux bash HOWTO use dig script, get WAN public IP address, check local network status, and contact who is behind sites.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-02-17
#
# _______________| digy : tame DNS utility dig with reasonable options.
#
# Usage: digy [address] [rev|name|short|mail|all|long|longa|who]
#
# Examples: % digy friendfeed.com
# 69.63.180.52
# # default second argument is 'short'
@nimbupani
nimbupani / index.html
Created December 2, 2011 05:00
Showing latest post on home page with Jekyll
---
layout: default
---
<div class="blog-index">
{% assign post = site.posts.first %}
{% assign content = post.content %}
{% include post_detail.html %}
</div>