Skip to content

Instantly share code, notes, and snippets.

View jamlfy's full-sized avatar
🏡
Working from home

Jamlfy jamlfy

🏡
Working from home
View GitHub Profile
@jamlfy
jamlfy / .hyper.js
Last active May 7, 2020 15:14
Consoles/Terminal
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
hyperline: {
plugins: ["ip", "hostname", "cpu", "memory", "network"],
},
hyperTabsMove: {
@jamlfy
jamlfy / docker-compose.yml
Created August 5, 2019 22:10
Template Wordpress
version: '3'
services:
# MySQL image
mysql:
image: mysql:5.7
container_name: mysql5.7
restart: always
expose:
- "3306"
ports:
Array.prototype.flatten = function() {
var output = [],
value;
for (var i = this.length - 1; i >= 0; i--) {
if (Array.isArray(this[i]) && this[i].length > 0) {
value = this[i].flatten();
for (var f = 0; f < value.length; f++) output.push(value[f]);
} else if (!Array.isArray(this[i])) {
output.push(this[i]);
}
@jamlfy
jamlfy / compresor.js
Last active January 29, 2019 21:29
Compressor the rules in CSS
const css = require('css');
const fs = require('fs');
const path = require('path');
const fileIn = path.join(__dirname, 'style.css');
const fileOut = path.join(__dirname, 'out.css');
Object.fromEntries = Object.fromEntries || ((x) => x.reduce((p,c) => {p[c[0]]=c[1];return p;},{}));
fs.readFile(fileIn, {encoding: 'utf-8'}, function(err,data){
@jamlfy
jamlfy / Muyian.js
Last active June 10, 2020 21:51
Minimal Date
class Muyian extends Date {
to (date, locale) {
return this.diff(date, true);
}
form (date, locale) {
return this.diff(date, true);
}
@jamlfy
jamlfy / post-merge
Last active August 21, 2018 15:31
Auto Build in git
#/usr/bin/env bash
# MIT © Alejo Next
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
##
# check_run()
import UIkit
import WebSocket
...
// Mobile
socket = WebSocket(url: URL(string: "ws://localhost:8080/")!)
//websocketDidConnect
socket.onConnect = {
print("websocket is connected")
import { Injectable } from '@angular/core';
@Injectable()
export class Notifications {
permition = false;
constructor() {
if (!("Notification" in window)) {
Notification.requestPermission( (e) => this.__granted(e));
}
}
@jamlfy
jamlfy / .zshrc
Last active February 17, 2017 21:46
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -e
# End of lines configured by zsh-newuser-install
source ~/.config/antigen.zsh
. "$(brew --prefix nvm)/nvm.sh"
/*** HOME ***/
var HOME = 'http://www.plotandesign.net/';
/*** WHERE ***/
var HOME_CONTENT = '#content .row2 > .main > .wrapper > .col1.cols',
POST_MENU = 'ul.left a',
TOP_MENU = '#header .menu li > a',
CONTENT_POST = '#content .row2 .main > .wrapper';
/*** DATA ***/