Skip to content

Instantly share code, notes, and snippets.

@dmnsgn
dmnsgn / .eslintrc.js
Created July 23, 2015 13:31
.eslintrc Google JavaScript Style Guide (eslint v0.24.1)
{
// http://eslint.org/docs/rules/
"env": {
"browser": true, // browser global variables.
"node": false, // Node.js global variables and Node.js-specific rules.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
@vdcrim
vdcrim / ddc-ci.py
Created February 11, 2015 00:35
Python script for adjusting the settings of my monitor, by using DDC/CI
#!/usr/bin/env python3
"""
Show and adjust display parameters on an Iiyama ProLite XB2483HSU-B1 monitor
Requirements:
- mentioned monitor (27' should also work) with DDC/CI setting on
- Windows Vista+
- Python 3
@ip2k
ip2k / index.js
Last active August 29, 2015 14:14
Hipchat plugin for the uptime project - https://github.com/fzaninotto/uptime
/**
* HipChat plugin for the uptime project - https://github.com/fzaninotto/uptime
*
* This index.js files goes to a directory `plugins/hipchat` in your installation of uptime.
*
* Notifies all events (up, down, paused, restarted) to HipChat
*
* This plugin has a dependency on `hipchatter`.
* Add this to the "dependencies" object in your `package.json` file :
*
@bcahue
bcahue / ConvertNewSteamID.markdown
Created September 24, 2014 15:04
Converting New SteamID Formats in Python

Seeing how SteamIDs have changed recently, I thought I'd write a Gist to help others (including myself!) decypher how to convert these from one format to the other in Python. First, let's go over basics to convert a 64bit CommunityID into a SteamID:

steamid64ident = 76561197960265728

def commid_to_steamid(commid):
  steamid = []
  steamid.append('STEAM_0:')
  steamidacct = int(commid) - steamid64ident
  
@ip2k
ip2k / python_time
Last active August 29, 2015 14:04
#pythonTime
import time, datetime
length=5 # 5 minutes from now
start_time = datetime.datetime.strftime(datetime.datetime.now(), "%Y-%m-%d %H:%M:%S")
stop_time = datetime.datetime.strftime(datetime.datetime.now() + datetime.timedelta(minutes=int(length)), "%Y-%m-%d %H:%M:%S")
epoch_start_local = int(time.mktime(datetime.datetime.now().timetuple()))
epoch_start_utc = int(time.mktime(datetime.datetime.utcnow().timetuple()))
epoch_stop_local = int(time.mktime(datetime.datetime.timetuple(datetime.datetime.now() + datetime.timedelta(minutes=length))))
epoch_stop_utc = int(time.mktime(datetime.datetime.timetuple(datetime.datetime.utcnow() + datetime.timedelta(minutes=5))))
@thom-nic
thom-nic / build.gradle
Last active November 16, 2023 07:35
find the largest classnames in Spring libraries. Also find FactoryFactories
/**
* Find the longest class names in Spring.
* Also find FactoryFactory classes.
* a goof-off project by @thom_nic
*/
import java.util.jar.*
defaultTasks 'longest', 'factoryfactory'
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@tintinweb
tintinweb / asn1cer.py
Last active July 17, 2022 14:45
python ASN1 decoder, x509 certificate decoder, no external dependencies
'''
@author: tintinweb
python asn.1 decoder including utility functions for pem format certificates
'''
import re,hashlib, binascii
class ASN1Element(object):
TYPE_UNIVERSAL = 0x00
@hwdsl2
hwdsl2 / .MOVED.md
Last active May 4, 2024 03:19
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
@jswank
jswank / queue_checks.json
Created January 8, 2014 17:19
Example Sensu check, which only alerts after 10 failures on a 60 second interval, and won't alert on nights or weekends.
{
"checks": {
"noisy_queue_check": {
"handler": "default",
"command": "/etc/sensu/plugins/check-queue-length.rb",
"interval": 60,
"refresh": 60,
"occurrences": 10,
"subscribers": [
"workers"