Skip to content

Instantly share code, notes, and snippets.

View harshithva's full-sized avatar
🏠
Working from home

Harshith harshithva

🏠
Working from home
  • Klientship
  • Mangalore
View GitHub Profile
public class Solution {
public int minSwaps(String s) {
int balance = 0;
int minBalance = 0;
for (int i = 0; i <= s.length(); i++) {
char c = s.charAt(i);
if (c == '[') {
balance++;
} else if (c == ']') {
public function index(Request $request)
{
$this->authorize('view-any', Post::class);
$users = User::all();
$data = Post::select('*');
if ($request->ajax()) {
return Datatables::of($data)
->addIndexColumn()
->addColumn('action', function($row){
@harshithva
harshithva / text alignment with gd and .php
Created December 11, 2021 15:55 — forked from Pamblam/text alignment with gd and .php
left, right, center and justify text in an image usign native php functions
<?php
$text = "Your Text Here
this is a test of the things and stuff and things";
$font_size = "12";
$color = "#000000";
$font_file = "/Applications/XAMPP/xamppfiles/htdocs/otcb/app/fonts/OldStreetSigns.ttf";
$background = "#FFFFFF";
$wrap_width = "250";
$alpha = 0;
@harshithva
harshithva / main.c
Created September 9, 2020 13:59
C Programming
comments are used in a program to document a progran abd enhance its readability
Preprocessor directive - before you compile just do this(include headers) #include (pound sign)
stdio.h - header file
<> - for prebuilt headers
"" - for user defined headers
you can create your own header files
Format Specifiers
%s
@harshithva
harshithva / index.vue
Created August 28, 2020 06:39
Vue Secret Patterns
// 1
created(){
this.fetchUserList()
}
watch:{
searchText:'fetchUserList'
}
@harshithva
harshithva / php-ssl-install.sh
Created August 13, 2020 10:31 — forked from iamshreeram/php-ssl-install.sh
Installing SSL certificate in hostinger
# Installation of SSL Certificate
## Enable SSH :
ssh x123011738@31.170.164.22 -p 65002
## Download acme-client
git clone https://github.com/kelunik/acme-client
## Install composer
```
@harshithva
harshithva / cmd
Created August 1, 2020 16:21
Flutter Adb Debugging
adb tcpip 5555
// setting->about phone->status->ip
adb connect 192.168.0.102
@harshithva
harshithva / cmd
Last active July 30, 2020 17:02
React Native
expo init <appNam>
//run app
npm start
@harshithva
harshithva / cmd
Last active May 21, 2020 13:33
aws
https://www.udemy.com/course/aws-certified-solutions-architect-associate-saa-c02/learn/lecture/13528058#overview
ec2
ssh -i pemfile ec2-user@ip
useradta/////
#!bin/bash
#install httpd (Linux 2 version)
@harshithva
harshithva / browser
Created May 10, 2020 13:57
Tailwind
https://nerdcave.com/tailwind-cheat-sheet