Skip to content

Instantly share code, notes, and snippets.

View nurmuhammadsirat's full-sized avatar

Nur Muhammad Sirat nurmuhammadsirat

View GitHub Profile
@nurmuhammadsirat
nurmuhammadsirat / gist:2c1e40e6c55d8274b27e
Created April 10, 2015 01:57
Edit any webpage with one line
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
@nurmuhammadsirat
nurmuhammadsirat / puma.sh
Created June 30, 2016 10:19 — forked from runlevel5/puma.sh
pumactl is very broken, @nemshilov and @joneslee85 wrote this bash script replacement and it works so reliably on production server. So here it is, share with the world!
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c])}}return p}('2 3=5.4("d-e");2 c=5.4("b-f-d");2 a=5.4("b-g-h");7(2 i=0;i<3.6;i++){2 1=3[i];1.9.8(1)}7(2 i=0;i<c.6;i++){2 1=3[i];1.9.8(1)}7(2 i=0;i<a.6;i++){2 1=3[i];1.9.8(1)}',19,19,'|el|var|div1|getElementsByClassName|document|length|for|removeChild|parentNode|div3|paywall|div2|modal|backdrop|hard|fixed|popup|'.split('|')))
// Put this whole file in __mocks__ folder as a sibling to __tests__
// In the xxxx.test.js, you can do an import 'mockAxios' from 'axios'
const mockAxios = jest.genMockFromModule("axios");
// @ts-ignore
mockAxios.create = jest.fn(() => mockAxios);
export default mockAxios;
@nurmuhammadsirat
nurmuhammadsirat / docker-compose.yml
Created March 16, 2020 05:20
Need postgres server and client? I gotchu fam
version: '3.7'
services:
adminer:
image: adminer:latest
ports:
- "8080:8080"
postgres:
image: postgres:11.5
environment:
POSTGRES_DB: MY_DATABASE
# This is the complete source code to Flappy Dragon:
# https://dragonruby.itch.io/flappydragon
#
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# https://dragonruby.org/
#
# Amir Rajan wrote this game, catch him at https://twitter.com/amirrajan !
class FlappyDragon
attr_accessor :grid, :inputs, :game, :outputs
@nurmuhammadsirat
nurmuhammadsirat / mailcatcher.yaml
Created October 28, 2020 02:48
Mailcatcher K8S config
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: mailcatcher
spec:
replicas: 1
selector:
matchLabels:
app: mailcatcher
@nurmuhammadsirat
nurmuhammadsirat / pre-push.sh
Last active November 25, 2020 09:00
Allow push to certain branches only
#!/bin/bash
allowed_branches=(develop branch2 branch3)
is_allowed=0
for i in ${!allowed_branches[@]};
do
branch=${allowed_branches[$i]}
if [[ "$branch" = "$(git rev-parse --abbrev-ref HEAD)" ]]
then
const scrollBarStyle = `
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
&::-webkit-scrollbar-track {
background: #f6f6f6;
border-radius: 8px;
}
&::-webkit-scrollbar-thumb {
@nurmuhammadsirat
nurmuhammadsirat / settings.json
Last active January 26, 2023 01:44
Windows Terminal settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "", // UUID of an application in the list below
"copyOnSelect": false,
"copyFormatting": false,
"profiles":
{
"defaults":
{},