Skip to content

Instantly share code, notes, and snippets.

@rootulp
rootulp / css-specificity.md
Last active January 15, 2019 01:12
CSS Specificity - Lightning Talk

Specificity determines, which CSS rule is applied by browsers.

General Rule: You want to be as specific as it makes sense to be. If some styling isn't applied to an element, check the specificity.

Most specific to least specific
  1. Inline Styles

An inline style lives within your HTML document. It is attached directly to the element to be styled.

@rootulp
rootulp / javascript-call-vs-apply.md
Last active January 15, 2019 01:13
.call() VS .apply() - Lightning Talk

Javascript .call() VS .apply()

When to use .call() or .apply()?

General Rule: Use .call() or .apply() when you want to execute a function in a different context or scope. *Keep in mind .call() and .apply() can only be called on functions.

var person1 = {name: 'Marvin', age: 20};
var person2 = {name: 'Zaphod', age: 30};
@rootulp
rootulp / main.rs
Created January 6, 2015 07:51
CracklePop implementation in Rust
fn main() {
let mut i :uint = 1;
while i <= 100 {
if i % 15 == 0 {
println!("CracklePop");
}
else if i % 5 == 0 {
println!("Pop");
}
else if i % 3 == 0 {
@rootulp
rootulp / tmux-resurrect-auto-rename.sh
Created May 5, 2016 00:57
workaround for a bug in tmux-resurrect
#!/bin/bash
echo "tmux-ressurect-automatic-rename started!"
for session_window in $(tmux list-windows -a -F '#{session_name}:#{window_index}'); do
tmux set-window-option -t $session_window automatic-rename on
echo "automatic-rename enabled for $session_window"
done
@rootulp
rootulp / export_foursquare_checkins.py
Last active June 13, 2020 01:38 — forked from dlo/export_foursquare_checkins.py
Download all your Foursquare checkins with Python.
# Before running this script execut the following command:
# $ pip install requests
# To run this script execute:
# $ python export_foursquare_checkins.py
import requests
import json
url_template = 'https://api.foursquare.com/v2/users/self/checkins?limit=250&oauth_token={}&v=20131026&offset={}'
# If you navigate to https://developer.foursquare.com/docs/explore, Foursquare
@rootulp
rootulp / intro-to-vim.md
Last active August 18, 2017 21:33
Palantir Cotyledon Lightning Talk

What is Vim?

Vim is a text editor

Why use Vim?

  • Efficiency
  • It's everywhere (all of your PCloud or on premise servers)

Why don't more people use Vim?

  • Steep learning curve
@rootulp
rootulp / frontend-tests.md
Last active January 9, 2022 17:05
Frontend tests knowledge share 📚

What are tests?

Unit test: A test written by a programmer for the purpose of ensuring that the production code does what the programmer expects it to do.

Other types of tests: integration test, end-to-end test, acceptance test, etc.

Why test?

  • Tests can improve API design 🏗
  • Tests can help document what something is supposed to do 📃
@rootulp
rootulp / convert.ts
Created June 27, 2021 18:36
Query ERC20 token balance on Elrond
export function convertBigEndianArray(arr: Uint8Array): number {
let sum = 0;
for (let i = 0; i < arr.length; i++) {
sum *= 256;
sum += arr[i];
}
return sum;
}
@rootulp
rootulp / docker-compose.yml
Last active November 26, 2021 05:45 — forked from tedder/docker-compose.yml
helium validator + watchtower (with consensus check) + exporter
# Source: https://gist.github.com/tedder/e40460e92adbff07f6890806e12eb444
# launch: docker-compose up -d
version: "3.7"
services:
validator:
image: quay.io/team-helium/validator:latest-validator-amd64
container_name: validator
init: true
restart: always
ports:
@rootulp
rootulp / attestation.txt
Created April 10, 2022 17:31
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 269
Hash: 74ecbdb6 4e83b2ba 06b40f2a 13c76b69
34c9673e b466bf48 dfd59310 27c136ae
78a941f2 ae872050 c3bf5ac9 f0e2ee81
7b862945 890063e7 7df29f2f bc10f7dd