Skip to content

Instantly share code, notes, and snippets.

@shivamMg
shivamMg / against-bots
Last active September 8, 2021 16:21
csgo
mp_maxrounds 20
bot_quota 14
bot_add_ct / bot_add_t
@shivamMg
shivamMg / js.py
Created November 1, 2020 10:06
JavaScript objects in python
class JSObject:
def __init__(self):
self.__dict__['_props'] = {}
def __setattr__(self, name, value):
self.__dict__['_props'][name] = value
def __getattr__(self, name):
return self.__dict__['_props'].get(name)
def __setitem__(self, name, value):
self.__dict__['_props'][name] = value
def __getitem__(self, name):
printf "♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜\n♟︎ ♟︎ ♟︎ ♟︎ ♟︎ ♟︎ ♟︎ ♟︎\n\n\n\n\n♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙\n♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖\n"
#!/usr/bin/env python2
# Need to install rapyuta_io Python SDK to use this script:
# pip install https://storage.googleapis.com/rio-sdk-python/rapyuta_io-0.13.0-py2-none-any.whl
from rapyuta_io import Client, DeploymentPhaseConstants
# Read how to get auth-token and project-guid here:
# https://userdocs.rapyuta.io/developer-guide/tooling-automation/python-sdk/sdk-tokens-parameters/
AUTH_TOKEN = ''
import sys
from collections import defaultdict
import rospy
from actionlib_msgs.msg import GoalID, GoalStatus, GoalStatusArray
statuses = defaultdict(list)
status_strs = [
'PENDING',
@shivamMg
shivamMg / consumer.py
Last active April 22, 2020 11:36
kombu producer consumer (pyamqp / librabbitmq)
from kombu import Connection, Exchange, Queue
from kombu.common import maybe_declare
from kombu.mixins import ConsumerMixin
HOST = ''
USER = ''
PASSWORD = ''
PORT = 443
SSL = {'server_hostname': HOST} # False
TRANSPORT = 'pyamqp' # pyamqp/librabbitmq
<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- ===================================================================================\
\ -->\n<!-- | This document was autogenerated by xacro from /opt/ros/melodic/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf.xacro\
\ | -->\n<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED \
\ | -->\n<!-- ===================================================================================\
\ -->\n<robot name=\"turtlebot3_waffle\">\n <!-- Init colour -->\n <material name=\"\
black\">\n <color rgba=\"0.0 0.0 0.0 1.0\"/>\n </material>\n <material name=\"\
dark\">\n <color rgba=\"0.3 0.3 0.3 1.0\"/>\n </material>\n <material name=\"\
light_black\">\n <color rgba=\"0.4 0.4 0.4 1.0\"/>\n </material>\n <material\
\ name=\"blue\">\n <color rgba=\"0.0 0.0 0.8 1.0\"/>\n </material>\n <material\
\ name=\"green\">\n <color rgba=\"0.0 0.8 0.0 1.0\"/>\n </material>\n <material\
from librabbitmq import Connection
conn = Connection(
host='<host>:443',
userid='<userid>',
password='<password>',
virtual_host='/',
ssl={
'server_hostname': '<host>'
},
@shivamMg
shivamMg / greet.c
Last active January 27, 2020 19:18
Simple example for building C Shared Libraries with Go
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "libhello.h"
int main(int argc, char **argv) {
char *name, *greeting;
if (argc < 2) {
fprintf(stderr, "missing name\n");
@shivamMg
shivamMg / timer.go
Last active November 9, 2019 06:08
Time a function in Go
package main
import (
"fmt"
"time"
)
func main() {
work()
}