This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getYfromElem(query) { | |
return window.pageYOffset + document.querySelector(query).getBoundingClientRect().top; | |
} | |
function smoothAsButter(elem, dur) { | |
var startY = window.pageYOffset; | |
var elemY = getYfromElem(elem); | |
var resultY = document.body.scrollHeight - elemY < window.innerHeight ? document.body.scrollHeight - window.innerHeight : elemY; | |
var diff = resultY - startY; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/zgrav/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="agnoster" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html from 'slate-html-serializer'; | |
// import React from 'react'; | |
// import { FunctionTypes } from 'constants/editor/ViewModel'; | |
// import { Nodes } from 'components/editor'; | |
import { getEventTransfer } from 'slate-react'; | |
import { BlockTypes } from 'constants/editor'; | |
import { Block } from 'slate'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
(function() { | |
const file = '/tmp/file.txt'; | |
const unlink = function() { | |
return new Promise((resolve, reject) => { | |
fs.unlink(file, function(e) { | |
if (e) { return reject(e); } | |
return resolve(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
bool isvalueinarray(string val, int *arr, int size){ | |
int i; | |
for (i=0; i < size; i++) { | |
if (arr[i].nome == val) | |
return true; | |
} | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.com$ [NC] | |
RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Backing up the OVH server, checking the archive and sending it through FTP | |
# | |
BACKUPHOME=/home/backups | |
FTPUSER=ftpbackupser | |
FTPPASS=S0m3Th1nGH4rD | |
FTPSERVER=ftp.server.com | |
SERVER=youservername |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find mydir -type f -exec curl -u xxx:psw --ftp-create-dirs -T {} ftp://xxx/{} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOG_FILE=/tmp/curlup_log.log | |
find mydir -type f -exec curl -u xxx:psw --ftp-create-dirs -T {} ftp://xxx/{} \; 2>&1 | tee ${LOG_FILE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/null > /var/log/lastlog && cat /dev/null > ~/.bash_history && history -c && exit |