Skip to content

Instantly share code, notes, and snippets.

View hardfire's full-sized avatar
🥑
avoca-do-ing

अभिनाश (Avinash) hardfire

🥑
avoca-do-ing
View GitHub Profile
//@ts-nocheck
import Constants, {AppOwnership} from 'expo-constants';
import {Image} from 'react-native';
let ImageElement = Image;
function init() {
// https://docs.expo.dev/versions/latest/sdk/constants/
// AppOwnership.Expo - The experience is running inside of the Expo Go app.
if (Constants.appOwnership !== AppOwnership.Expo) {
import('react-native-fast-image').then((FastImage) => {
@hardfire
hardfire / README.MD
Last active August 12, 2021 03:34
using cgroups to limit browser memory+cpu usage
  1. cgconfig.conf - that's where you create the control group /etc/
  2. cgrules.conf - that's where you add binaries to that specific control group /etc/
  3. cgconf - that's the init script i use because its not available on ubuntu. It might be available for your OS in the package manager. I took the startup script from http://askubuntu.com/questions/836469/install-cgconfig-in-ubuntu-16-04 - /etc/init.d/

Notes

Use the following steps to test what you have without the

  • cgconfigparser -l /etc/cgconfig.conf - to add/register your control group to the system
  • cgrulesengd - sends the binary-cgroup binding rules.
@hardfire
hardfire / eleventy_build.yml
Created May 18, 2020 06:18
Use this action to build an eleventy site and push to gh-pages
name: Eleventy Build
on: [push]
jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build using node.ks
uses: actions/setup-node@v1
@hardfire
hardfire / db.sql
Created July 20, 2017 10:55
knex+bookshelf+graphql
/* i created the database manually, but here are the queries to create the db schema in POSTGRES */
CREATE TABLE students (id SERIAL PRIMARY KEY, name TEXT );
CREATE TABLE homeworks (id SERIAL PRIMARY KEY, student_id INT NOT NULL REFERENCES students, subject TEXT);
CREATE TABLE pages (id SERIAL PRIMARY KEY, homework_id INT NOT NULL REFERENCES homeworks, content TEXT);
@hardfire
hardfire / .bashrc
Created April 9, 2017 05:40
HOWTO: autocompletion in a bash function/alias
# I have a function called as shocker which 'sh-es' into a docker container
# to enable autocompletion in the command, I do the following
# `complete -F __docker_complete_container_names shocker`
# __docker_complete_container_names is a function available in /etc/bash_completion.d/docker
# the above file is available at https://docs.docker.com/machine/completion/
# the __docker_complete_container_names function does something like the following
# COMPREPLY=( $(compgen -W "(list of containers)" -- "$cur") )
# documentaton : http://www.tldp.org/LDP/abs/html/tabexpansion.html
CLONING INTO 'LARGE-REPOSITORY'...
REMOTE: COUNTING OBJECTS: 20248, DONE.
REMOTE: COMPRESSING OBJECTS: 100% (10204/10204), DONE.
ERROR: RPC FAILED; CURL 18 TRANSFER CLOSED WITH OUTSTANDING READ DATA REMAINING
FATAL: THE REMOTE END HUNG UP UNEXPECTEDLY
FATAL: EARLY EOF
FATAL: INDEX-PACK FAILED
@hardfire
hardfire / backbone-delay-context.js
Last active December 29, 2015 04:59
backbone delay context
_(function() {
this.trigger("awesome:event");
}).chain().bind(this).delay(500);
// Other ways of doing it in the github page
//https://github.com/jashkenas/underscore/issues/494
@hardfire
hardfire / dabblet.css
Created August 19, 2013 05:26 — forked from anonymous/dabblet.css
Untitled
body{
background:#ddd;
margin:0;
font-family:arial;
font-size:44px;
font-weight:bold;
text-shadow:1px 1px 1px #aaa;
}
#bg1{
margin:200px 0px;
@hardfire
hardfire / dabblet.css
Created August 15, 2013 17:03
ACM Logo in CSS, challange accepted
/**
* ACM Logo in CSS, challange accepted
*/
#acm-logo{
width:200px;
height:200px;
position:relative;
}
#diamond{

Keybase proof

I hereby claim:

  • I am hardfire on github.
  • I am avk (https://keybase.io/avk) on keybase.
  • I have a public key whose fingerprint is CD06 A8C0 F9D7 B214 FA34 F2F3 08C9 0234 6F12 1797

To claim this, I am signing this object: