Skip to content

Instantly share code, notes, and snippets.

View and3rson's full-sized avatar
♥️
Time You Enjoy Wasting Is Not Wasted Time.

Andrew Dunai and3rson

♥️
Time You Enjoy Wasting Is Not Wasted Time.
View GitHub Profile
@rougier
rougier / progress_bar.py
Created January 25, 2016 06:25
A progress bar using unicode character for smoother display
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Nicolas P. Rougier
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import sys, math
def progress(value, length=40, title = " ", vmin=0.0, vmax=1.0):
"""
Text progress bar
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@mapkyca
mapkyca / python_regex.py
Created July 26, 2015 10:46
Quick python regex callback example, for my memory
import re
def callback(match):
return "<a href=\"http://github.com/%s>%s</a>" % (match.group(0), match.group(0))
string = "this is a #test #32345 dfsdf"
print re.sub('#[0-9]+', callback, string)
@MikeNGarrett
MikeNGarrett / siege
Last active December 3, 2024 17:20
Siege with JSON POST data
# Changed to use content-type flag instead of header: -H 'Content-Type: application/json'
siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}'
@edolganov
edolganov / main_out.js
Created May 10, 2015 17:19
agar.io game client with bots
//replace http://agar.io/main_out.js by this file
//with Fiddler Web Debugger (AutoResponder tab)
//bots can be created in different rooms - so try restart the page if need
var totalBotCount = 0;
function game(h, r, bot, botUrl, botName) {
@sandeepmistry
sandeepmistry / BLEPeripheral_NeoPixel.ino
Created March 25, 2015 23:14
BLEPeripheral + NeoPixel
// Import libraries (BLEPeripheral depends on SPI)
#include <SPI.h>
#include <BLEPeripheral.h>
#include <Adafruit_NeoPixel.h>
// define pins (varies per shield/board)
#define BLE_REQ 10
#define BLE_RDY 2
#define BLE_RST 9
@ShadeJackrabbit
ShadeJackrabbit / FoxReplace.json
Last active December 1, 2016 11:02
FoxReplace Options Sheet
{
"version": "0.15",
"groups": [
{
"name": "Downworthy",
"urls": [],
"substitutions": [
{
"input": "will blow your mind",
"inputType": "text",
@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@jackinside
jackinside / TickTickProviderHelper
Last active December 5, 2024 17:46
A utility class to work with TickTick's Content Provider. A full guide is available at https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
/**
* This class provides the URI, const values and some methods to work with TickTick's Content Provider.
*
* A guide is available on https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
*/
public class TickTickProviderHelper {
private static final Uri TASK_URI = Uri.parse("content://com.ticktick.task.data/tasks");
private static final Uri PROJECT_URI = Uri.parse("content://com.ticktick.task.data/tasklist");
private static final String TASK_CONTENT_ITEM_TYPE = "vnd.android.cursor.item/ticktick.task.task";
@croxis
croxis / basic.py
Last active February 4, 2021 15:41
CEFPython for Panda3D
from cefpython3 import cefpython
import os
import sys
from panda3d.core import loadPrcFileData
loadPrcFileData("", "Panda3D example")
loadPrcFileData("", "fullscreen 0")
loadPrcFileData("", "win-size 1024 768")