Skip to content

Instantly share code, notes, and snippets.

View testman42's full-sized avatar
:octocat:
Converting caffeine into code

testman42

:octocat:
Converting caffeine into code
View GitHub Profile
@Koncord
Koncord / server.lua
Created July 23, 2016 14:21
Example for TES3MP GUI
function OnPlayerSendMessage(pid, message)
local pname = tes3mp.GetName(pid)
print(pname.."("..pid.."): "..message)
if myMod.OnPlayerMessage(pid, message) == 0 then
return 0
end
if message:sub(1,1) == '/' then
local cmd = (message:sub(2, #message)):split(" ")
# coding: utf-8
# Imports
import os
import cPickle
import numpy as np
import theano
import theano.tensor as T
@baybatu
baybatu / limit-number.py
Created June 26, 2016 06:27
Limiting input number between minimum and maximum values range in Python
def limit(num, minimum=1, maximum=255):
"""Limits input 'num' between minimum and maximum values.
Default minimum value is 1 and maximum value is 255."""
return max(min(num, maximum), minimum)
@derhuerst
derhuerst / output.js
Created May 10, 2016 10:22
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}
@B0073D
B0073D / sopel_adapter.py
Last active January 21, 2016 15:55
Early work for Sopel Adapt integration. This could be one possible way for Adapt to be used in a 'simple' manner.
import sopel.module
import sopel.formatting
# Adapt imports:
import json
from adapt.intent import IntentBuilder
from adapt.engine import IntentDeterminationEngine
def adapter(*intent_list):
@xPaw
xPaw / steam_quick_queue.user.js
Last active April 22, 2026 02:24
⚠ This script has been integrated into SteamDB browser extension!
// ==UserScript==
// @name Steam Queue Auto Discoverer
// @description Discover the Steam queue three times to get the sale cards
// @version 2.3.0
// @namespace https://gist.github.com/xPaw/73f8ae2031b4e528abf7
// @icon https://store.steampowered.com/favicon.ico
// @match https://store.steampowered.com/explore*
// @grant none
// ==/UserScript==
@Extraltodeus
Extraltodeus / Cutwallpaper - Read me
Last active January 22, 2016 01:02
This script was made for triple monitor users, to automatically cut a picture in 3 equal parts, with good proportions
As far as I know you can put the .desktop file in ~/.local/share/kservices5/ServiceMenus/ if you're on Plasma 5
Don't forget to edit the commented lines if you want it to work as you wish.
The right-click function does not seem to work when there is a space in the path. Yet.
@boeric
boeric / README.md
Last active December 3, 2024 14:47
D3 Real Time Chart with Multiple Data Streams

D3 Based Real Time Chart with Multiple Streams

The real time chart is a resuable Javascript component that accepts real time data. The purpose is to show the arrival time of real time events (or lack thereof), piped to the browser (for example via Websockets). Various attributes of each event can be articulated using size, color and opacity of the object generated for the event.

The component allows multiple asynchronous data streams to be viewed, each in a horizontal band across the SVG. New data streams can be added dynamically (as they are discovered by the caller over time), simply by calling the yDomain method with the new array of data series names. The chart will automatically fit the new data series into the available space in the SVG.

The chart's time domain is moving with the passage of time. That means that any data placed in the chart eventually will age out and leave the chart. Currently, the chart history is capped at five minutes (but can be changed by modifying the comp

@xero
xero / irc.md
Last active August 2, 2026 03:48
irc cheat sheet
@felix-orduz
felix-orduz / download.sh
Last active September 18, 2020 15:03
Download files with zenity progress bar
#!/bin/bash
DOWNLOAD() {
rand="$RANDOM `date`"
pipe="/tmp/pipe.`echo '$rand' | md5sum | tr -d ' -'`"
mkfifo $pipe
wget -c $1 2>&1 | while read data;do
if [ "`echo $data | grep '^Length:'`" ]; then
total_size=`echo $data | grep "^Length:" | sed 's/.*\((.*)\).*/\1/' | tr -d '()'`
fi
if [ "`echo $data | grep '[0-9]*%' `" ];then