Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Bunhouth BunHouth

🎯
Focusing
  • Remote Work
  • US Japan Singapore
View GitHub Profile
View gist:1537c7c6e2a31fda26e5ef14113f170d

Swap RAM

sudo fallocate -l 32G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
free -h
sudo cp /etc/fstab /etc/fstab.bak
View ETH-AWS-Staking.md
View VideoProcess.yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"
integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==
dependencies:
"@babel/highlight" "^7.8.3"
View VideoProcessing.package.json
{
"name": "RNVideoProcessingDemo",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
View VideoProcessing.js
import React, {useState} from 'react';
import RNFetchBlob from 'rn-fetch-blob'
import {
FlatList,
SafeAreaView,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
View permission.js
import messaging from '@react-native-firebase/messaging';
import PushNotification from 'react-native-push-notification';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import { navigate } from '@navigator/navigator';
import { registerDeviceToken } from '@state/auth/ActionCreator';
export const notificationHandler = data => {
if (data?.notify_type === 'comment') {
navigate('PostDetail', {
postId: data.target_id,
View booking.haml
- title nil
- meta_description nil
= render partial: 'shared/header', locals: { search_bar: false, fixed_top: false }
.container
%h1.booking-header
= t('.book_no_pay_later')
.row
View search_controller.rb
class SearchController < FrontendController
def index
@locations = locations
@search = Search.new(params, current_guest)
result = @search.paginate
respond_to do |format|
@data = { data: @search.search_results, total_count: @search.paginate[:total_count], total_pages: @search.paginate[:total_pages], per_page: 20, page: params[:page]}
query_params = params.except(:controller, :action, :search, :query).as_json
View Bayonia-Code-Snippet.js
// React Section
import React, {memo} from "react";
import {Provider} from "react-redux";
import configureStore from "~/store/configureStore";
import Notification from "~/components/Notification";
const store = configureStore();
const RoomRateAvailabilityTableHeader = memo(({dates, name, isFamily}) => {
const renderElements = () => {
View Nested Selected
import React, {useState} from "react";
import "./App.css";
const data = [
{id: 1, name: "meat", parent_id: null},
{id: 2, name: "vegi", parent_id: null},
{id: 3, name: "drink", parent_id: null},
{id: 4, name: "fish", parent_id: 1},
{id: 5, name: "beef", parent_id: 1},
{id: 6, name: "pork", parent_id: 1},
{id: 7, name: "raw", parent_id: 2},