Skip to content

Instantly share code, notes, and snippets.

View kasisnu's full-sized avatar
📡

Kasisnu kasisnu

📡
View GitHub Profile
@kasisnu
kasisnu / interfaces_intro.go
Created August 21, 2018 06:07
Somewhat relatable introduction to interfaces
package main
import "fmt"
type Speaker interface {
Speak() string
}
func Printer(s Speaker) {
fmt.Println(s.Speak())
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIOvF9NxWxSrVMUE6+4HJbB5mucG27Fwv+TZgAwd4DQNm6n6912m0umaTK2s44UaYVXrWoRKZYPWTpwXl2JbDOd6fEc1NKUIJjN97BA/B75hLtnuga1qdH79nzcl2mkw5KHOOnCbvfU5ZWXKYR5nET7zLN6hS6tkvFp4SxrGEGqTabvEUF2OhVNBCqMifp4bha+R0gueNxveyMkY3sL/1NBoDvRUphYpBfrzoQeJNMfFdNMCb4JfmR+uAczzGt2OJmW4Ntl/dr+sVA1bvi/3uUSQXWDndJ2RIORZ/0oiiGVPGi+QQrayfy0+/KRa345kprdnvjf+Y/2CRi2XZxlAZ+FU5ghaSaly9vokhN2XLI6KR8yNxs/p+q82Q4FDO3nTCpQoyWHrScq4Ypoz3VqF9vjpPy5vwOwVMj4sUwpfUPKTPRvSxAt4zJLnHMYPypUe12iNGmgda9SU19V9QZKLFp+p1ZDtwO5HrIDwTgM8UYMw+E8mg1PKtct5A+rjn1+dR7LWeUfoUorz0F/MQZR4NOiTnGuU5l5Kk+yypKG/Tsvei7kGytRhCbr4060tJHHF3lokrMMJGawOhCJwO2f6l5sZ/YEExU4K0xNWmPPUH7qG6oG6mtAJCtOqRRKptTSGrk1ZdL426oTVIvhfF0OahEWWcv/564M2C1oyktzamTPQ== kasisnu@m

Keybase proof

I hereby claim:

  • I am kasisnu on github.
  • I am kasisnu (https://keybase.io/kasisnu) on keybase.
  • I have a public key ASAatWk9vFN0PxHX_Dfi4Ehg8qbofw_ad1Mi7t8G8w-jtgo

To claim this, I am signing this object:

FROM ubuntu:trusty
RUN echo 'abc' > /tmp/some.file
@kasisnu
kasisnu / Git favourites backup
Last active May 26, 2017 15:44
A dirty way to download a backup of all starred repos on github.
#!/usr/bin/env python
from git import Repo
import requests
import json
import multiprocessing
import os
try:
cpus = multiprocessing.cpu_count()
#!/usr/bin/env python
import argparse
import socket
import os
parser = argparse.ArgumentParser(description='This is a socket listener. Specify port to listen on with -p. Specify file to write to with -f')
#Add arguments
parser.add_argument('-f', nargs='?' , help="This is the file to append to" )
parser.add_argument('-p', type=int , help="This is the port to listen on", required=False )
#!/usr/bin/env bash
#
# This shell script downloads drupal 7 and quickifies the setup for Suchi's L&L
#
#
drush dl drupal --drupal-project-rename='LLPanels'
cd LLPanels
echo "Enter your mysql username:"
@kasisnu
kasisnu / airtel.py
Last active August 29, 2015 14:05
This is a python script that tries to get the remaining balance from Airtel. Best used with a shell alias.
#!/usr/bin/env python
#
#
# This is a python script that tries to get the remaining balance from Airtel
#
#
import re
try:
@kasisnu
kasisnu / sleepbot_listener.py
Created August 16, 2014 00:51
This is a python script to play a random track when the Sleepbot "Punched in" notification is dismissed.
import sys
sys.path.insert(0, '/path/to/pyPushBullet')
import pushbullet
import subprocess
pushbullet_access_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
url = "wss://stream.pushbullet.com/websocket/" + pushbullet_access_token
a = pushbullet.PushBullet(pushbullet_access_token)
@kasisnu
kasisnu / Rule to auto translate
Created August 12, 2014 10:44
This is a Drupal rule which uses a custom component that auto translates nodes into multiple languages when they are first created.
{ "rules_auto_translate_to_multiple_languages" : {
"LABEL" : "Auto translate to multiple languages",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_insert" : [] },
"DO" : [
{ "component_tmgmt_node_ui_translate_node_to_multiple_languages" : {
"node" : [ "node" ],
"target_languages" : { "value" : [ "fr", "de" ] },