Skip to content

Instantly share code, notes, and snippets.

View qubbit's full-sized avatar
🎯
Focusing

Gopal Adhikari qubbit

🎯
Focusing
View GitHub Profile
{
"vars": {
"@brand-primary": "#22A7B3",
"@navbar-default-color": "#fff",
"@navbar-default-bg": "#22A7B3",
"@navbar-default-link-color": "#fff",
"@navbar-default-link-hover-color": "#fff",
"@navbar-default-link-active-color": "#fff",
"@navbar-default-toggle-hover-bg": "#22A7B3",
"@navbar-default-toggle-icon-bar-bg": "#fff",
@qubbit
qubbit / animating_circles.pde
Last active August 29, 2015 14:08
Animating Circles
/* @author: gopal adhikari
I saw an animation like this online several months ago, I cannot remember the site,
but that's where I got the inspiration from.
*/
void setup() {
size(800, 600);
noStroke();
smooth();
@qubbit
qubbit / SassMeister-input.scss
Created May 29, 2015 14:24
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
$color-map: (carpet: #7e57c2, garage: #EF5350, maid: #66BB6A, handyman: #FFA726);
@each $p, $c in $color-map {
.#{$p} .panel {
background: $c;
color: #fff;
@qubbit
qubbit / vortex0.cs
Created July 13, 2015 21:15
Your goal is to connect to port 5842 on vortex.labs.overthewire.org and read in 4 unsigned integers in host byte order. Add these integers together and send back the results to get a username and password for vortex1. This information can be used to log in using SSH. Note: vortex is on an 32bit x86 machine (meaning, a little endian architecture)…
using System;
using System.Text;
using System.Net.Sockets;
namespace WG
{
class Program
{
static void Main(string[] args)
{
@qubbit
qubbit / huffman_test.c
Created July 22, 2013 07:50
Sorting Array of Structs
#include <stdlib.h>
#include <stdio.h>
#define ARRAY_SZ 5
typedef struct SingleChar
{
unsigned char Character;
unsigned int Weight;
} *SingleCharPtr;
@qubbit
qubbit / himawari.ps1
Created February 4, 2016 16:14 — forked from MichaelPote/himawari.ps1
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@qubbit
qubbit / gen.swift
Created November 11, 2016 17:39 — forked from blainerothrock/gen.swift
A Very Simple Genetic Algorithm Written in Swift 3
#!/usr/bin/env xcrun swift
/*
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3
-------------------- https://gist.github.com/cfdrake/973505 ---------------------
gen.swift implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
@qubbit
qubbit / index.html
Last active February 23, 2017 18:48
An app to test signature verification
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="canvas" width="500" height="500"></canvas>
</body>
<script type="text/javascript">
var signature = [[1,85,37],[0,85,35],[0,85,32],[0,85,28],[0,85,16],[0,85,9],[0,85,4],[0,85,1],[0,85,0],[0,85,2],[0,85,6],[0,85,10],[0,85,18],[0,84,21],[0,84,22],[0,84,23],[0,84,24],[0,84,27],[0,84,30],[0,83,31],[0,83,33],[0,83,34],[0,83,35],[0,82,37],[0,82,35],[0,82,33],[0,82,32],[0,82,31],[0,82,30],[0,82,29],[0,82,28],[0,82,26],[0,82,25],[0,82,24],[0,82,23],[0,82,22],[0,82,21],[0,83,21],[0,87,18],[0,90,16],[0,92,14],[0,97,11],[0,98,10],[0,100,10],[0,100,9],[0,100,8],[0,100,9],[0,100,10],[0,100,11],[0,100,16],[0,100,20],[0,100,28],[0,100,32],[0,100,36],[0,100,38],[0,100,39],[0,100,40],[0,100,41],[0,100,42],[0,100,41],[0,100,40],[0,100,38],[0,100,36],[0,100,35],[0,100,31],[0,100,25],[0,100,23],[0,100,22],[0,100,21],[0,100,20],[0,100,21],[0,100,22],[0,100,24],[0,100,25],[0,100,28],[0,100,32],[0,100,33],[0,100,34],[0,100,36],[0,100,38],[0,100,39],[0,100,40]
{
"nodes":[
{
"x":73,
"y":52,
"text":"A",
"isAcceptState":true
},
{
"x":320,
@qubbit
qubbit / renew_certs.sh
Created April 6, 2018 04:24
Automatic Let's Encrypt Renewal
#!/usr/bin/env bash
RENEWAL_STATUS=$(certbot-auto certonly \
-d 'domain.com,sub.domain.com' \
--nginx \
-n \
--expand
)
curl -s --user 'api:key-MAILGUN_API_KEY' \