Skip to content

Instantly share code, notes, and snippets.

View rlingineni's full-sized avatar
💭
building cool stuff

Raviteja Lingineni rlingineni

💭
building cool stuff
View GitHub Profile
@rlingineni
rlingineni / Color Conversions
Created February 13, 2017 01:42
Different Conversions of Color Representations
using System;
using System.Collections.Generic;
namespace rgbConverter
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
@rlingineni
rlingineni / gist:54f16329ecb5206ad3bf769a762deb42
Created December 21, 2016 21:45
Hashtag Detection Xamarin.Forms
void Handle_MessageChanged(object sender, TextChangedEventArgs e)
{
Editor editor = sender as Editor;
string val = editor.Text; //Get Current Text
if (val.Length > 140)//If it is more than your character restriction
{
val = val.Remove(val.Length - 1);// Remove Last character
editor.Text = val; //Set the Old value
}
@rlingineni
rlingineni / file update config function
Created November 23, 2016 20:07
Raspberry Pi Wifi Config update function
console.log("Updating Wifi to SSD: " + SSID);
var data = fs.readFileSync('/etc/wpa_supplicant/wpa_supplicant.conf', 'utf8');
var result = data.replace(/ssid="(.*)"/g, 'ssid="'+ SSID + '"');
var finalResult = result.replace(/psk="(.*)"/g, 'psk="'+ Password + '"');
console.log("Will print: \n" + finalResult); //this prints out correctly, finalResult holds what I want it ot
//need to fix writing to file (only writes like a piece of it)
fs.writeFile('/etc/wpa_supplicant/wpa_supplicant.conf', finalResult, 'utf8', function (err) {
.data
str: .space 23 # buffer for input string
strNS: .space 23 # buffer for string w/o spaces
prompt: .asciiz "Enter a string up to 80 characters\n"
head1: .asciiz "\nOriginal String: "
head2: .asciiz "\nNumber of spaces: "
head3: .asciiz "\nWith spaces removed: "
head4: .asciiz "\nSeparated: "
endOfFileLine: .asciiz ".end"
@rlingineni
rlingineni / changeCalc.cpp
Created September 20, 2015 18:14
ChangeCalculator Program C++
#include <iostream>
#include <math.h>
using namespace std;
int main() {
//reads from input file, or takes user input. 1st is your total amount, and the second is how much you paid
double total;
//get change
cin >>total;