Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sulram on github.
  • I am sulram (https://keybase.io/sulram) on keybase.
  • I have a public key ASDQ3btK1kSH_1rWHHh2oF6nUI65V_XgyoYXi1RM0SPvXAo

To claim this, I am signing this object:

@sulram
sulram / git.sh
Created November 19, 2019 18:54
git
# git reset current branch HEAD to the commit
git reset --hard <commit-hash>
git push --force origin master
# git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
<div class="vimeo-full">
<iframe src="https://player.vimeo.com/video/355660592?background=1&autoplay=1&loop=1&byline=0&title=0"
frameborder="0"
webkitallowfullscreen
mozallowfullscreen
allowfullscreen>
</iframe>
</div>
<style>
.vimeo-full {
conda activate myenv
conda env export > environment.yml
@function responsive($value1, $value2, $width1: 320, $width2: 1920) {
$x1: $width1;
$x2: $width2;
$y1: $value1;
$y2: $value2;
$a: ($y2 - $y1) / ($x2 - $x1);
$b: ($x2 * $y1 - $x1 * $y2) / ($x2 - $x1);
@return calc(#{$a * 100vw} + #{$b * 1px});
}
import sqlite3
conn = sqlite3.connect("sessions.db")
cursor = conn.cursor()
cursor.execute("DROP TABLE IF EXISTS sessions")
cursor.execute("""
CREATE TABLE IF NOT EXISTS sessions(
id INTEGER PRIMARY KEY AUTOINCREMENT,
# disk usage
du -sh ~/*
du -sh ~/webapps/*
du -sh ~/webapps/example/example
# nvidia status
nvidia-smi
@sulram
sulram / CornerPin.shader
Created June 23, 2018 03:27 — forked from Happsson/CornerPin.shader
Four corner pin unity shader
Shader "Distort/CornerPin"
{
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_DLx("Down Left x", Range(-2.0,2.0)) = 0
_DLy("Down Left y", Range(-2.0,2.0)) = 0
_DRx("Down Right x", Range(-2.0,2.0)) = 0
_DRy("Down Right y", Range(-2.0,2.0)) = 0
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
CREATE CONSTRAINT ON (e:Empresa) ASSERT e.cnpj IS UNIQUE
CREATE CONSTRAINT ON (u:UF) ASSERT u.nome IS UNIQUE
CREATE INDEX ON :Socio(nome)
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///Brasil.csv' AS line
MERGE (empresa:Empresa { nome: line.nome_empresa, cnpj: line.cnpj_empresa })
MERGE (socio:Socio { nome: line.nome_socio, tipo: line.tipo_socio })