Skip to content

Instantly share code, notes, and snippets.

View basith374's full-sized avatar

Basith Kunimal basith374

View GitHub Profile
@basith374
basith374 / Category.js
Created November 12, 2016 11:30
here is the full file, the code was stripped & some aspects were renamed for breviity
import React, { PropTypes } from 'react';
import { View, Image, ScrollView, TouchableHighlight, Text, Animated } from 'react-native';
import images from '../../config/images';
import Icon from 'react-native-vector-icons/FontAwesome';
import styles from './styles';
import Loading from '../../components/Loading';
import settings from '../../config/settings';
export const HEADER_MAX_HEIGHT = 200;
const HEADER_MIN_HEIGHT = 0;
@basith374
basith374 / example.js
Created December 1, 2016 06:56
import/export
import SignIn from './SignIn';
@basith374
basith374 / .htaccess
Created March 21, 2017 12:14
laravel ssl redirect
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@basith374
basith374 / email.html
Created June 21, 2017 06:49
intercom like mail
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<title>Basith from Bluroe</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style type="text/css">
body {
-webkit-font-smoothing: antialiased;
@basith374
basith374 / index.html
Last active May 14, 2018 20:50
D3 V4 Circular Progress
<html>
<head>
<title>D3 Test</title>
<style>
body {
font-family: Rubik, sans-serif;
padding: 30px;
}
.row {
display: flex;
@basith374
basith374 / .bashrc
Created August 4, 2018 08:38
get child processes
function getcpid() {
cpids=`pgrep -P $1|xargs`
for cpid in $cpids;
do
echo "$cpid"
getcpid $cpid
done
}
@basith374
basith374 / ballot.sol
Created October 11, 2018 15:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@basith374
basith374 / pass.py
Created November 4, 2018 16:06
socket connect
import socket
import sys
if len(sys.argv) < 2:
print('usage: %s <deviceid> <cmd> [<params>]' % (sys.argv[0]))
exit()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('13.250.41.251', 8008))
@basith374
basith374 / email_error.py
Created February 26, 2019 07:38
construct code, pre tags for sending email error logs
def error_msg(msg):
styles = {
'background': '#f4f4f4',
'border': '1px solid #ddd',
'border-left': '3px solid #f36d33',
'color': '#666',
'page-break-inside': 'avoid',
'font-family': 'monospace',
'font-size': '13px',
'line-height': '1.6',
@basith374
basith374 / loading.css
Created March 2, 2019 09:00
loading spinner css
.ld-ring div {
width: 20px;
height: 20px;
border-radius: 50%;
border-width: 1px;
border-style: solid;
border-color: #555 transparent #555 transparent;
animation: ld-ring 0.7s linear infinite;
margin: 0 auto;
}