Skip to content

Instantly share code, notes, and snippets.

View sriganesh's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Sriganesh sriganesh

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
@tangert
tangert / SVG.sol
Last active April 22, 2024 23:32
SVG Solidity Library
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "./Utils.sol";
// Core SVG utilitiy library which helps us construct
// onchain SVG's with a simple, web-like API.
library svg {
/* MAIN ELEMENTS */
function g(string memory _props, string memory _children)
internal
@prologic
prologic / LearnGoIn5mins.md
Last active April 30, 2024 15:10
Learn Go in ~5mins
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.

Upgrade nodejs to v12.x.x

$ sudo npm install -g n
$ sudo n lts

Install hsd

Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@apolloclark
apolloclark / lock_down_public_s3_buckets.md
Last active January 27, 2023 08:10
Bash one-liner to find public facing AWS S3 buckets, and make them private

Command

aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'if [[ $(aws s3api get-bucket-acl --bucket {} --query '"'"'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` && Permission==`READ`]'"'"' --output text) ]]; then aws s3api put-bucket-acl --acl "private" --bucket {} ; fi'



1. List all of the user's buckets, and output the name, as text.

@dikiaap
dikiaap / git-io-custom-url.md
Last active August 5, 2023 04:21
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@vicskf
vicskf / single-event.php
Created September 14, 2017 21:40
The Events Calendar > Template override for the single-events.php template to overcome Divi theme Incompatibility with comments
<?php
/**
* Single Event Template
* A single event. This displays the event title, description, meta, and
* optionally, the Google map for the event.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
*
* @package TribeEventsCalendar
* @version 4.3

Becoming a Spring Certified Professional without the Core Spring Course

Until recently, the only way you could become a Certified Spring Professional was to take Pivotal’s compulsory, 4-day, Core Spring training course. On completion of the course, participants received an exam voucher that allowed them to schedule an exam at a certification centre.

At approximately £2.5k per attendee, the course is not cheap putting certification out of the reach of many self-funded developers and those that work for organisations without generous training budgets.

In May 2017 Pivotal changed their policy. Spring Certification Exams became available for individual purchase without enrolling in the course. I set out to see if it was possible to pass the exam without the Core Spring course and only using publically available material.

I set myself a budget of £250, ap

@dileeph
dileeph / gist:c5f9eae2f971d91e1dda
Created January 2, 2016 05:12
Getting List of Objects with RestTemplate in Spring
RestTemplate restTemplate = new RestTemplate();
try {
ResponseEntity<List<Claim>> claimResponse = restTemplate.exchange(
uri,
HttpMethod.GET,
null,
new ParameterizedTypeReference<List<Claim>>() {});
if(claimResponse != null && claimResponse.hasBody()){
claims = claimResponse.getBody();