Skip to content

Instantly share code, notes, and snippets.

View pveyes's full-sized avatar
:electron:

Fatih Kalifa pveyes

:electron:
View GitHub Profile
@pveyes
pveyes / fb-arithmetic.c
Last active January 3, 2016 00:09
My solution to Facebook Programming Challenge sample problem: Missing number in arithmetic sequence. Source: http://retina.pvey.es/solving-facebook-programming-challenge-sample-problem
#include <stdio.h>
int main() {
int input, val;
int init, delta = 0, newdelta;
int i;
scanf("%d\n", &input);
scanf("%d ", &init);
#include <stdio.h>
int main() {
int graph[] = {2, 5, 1, 3, 1, 2, 1, 7, 7, 6};
int size = sizeof(graph) / sizeof(graph[0]);
int water = waterization(graph, size);
printf("%d\n", water);
return 0;
}
@pveyes
pveyes / Preferences.sublime-settings
Last active January 3, 2016 01:19
My Sublime Text 3 Preferences
{
// My theme
"theme": "Spacegray.sublime-theme",
"color_scheme": "Packages/User/base16-ocean.dark (SL).tmTheme",
// Match Spacegray theme preview on Github
"bold_folder_labels": true,
"font_face": "Source Code Pro",
// force default line ending
@pveyes
pveyes / remove-quora-modal
Last active August 29, 2015 14:01
Remove Quora Annoying Modal
- Open console (Chrome: Ctrl+Shift+J)
- Type this: document.querySelector('[id*="modal_signup_wrapper"]').remove()
- Press ENTER
- PROFIT
module.exports = {
parser: 'babel-eslint',
plugins: ['babel', 'react'],
envs: {
es6: true,
node: true
},
ecmaFeatures: {
jsx: true
},
document.write('<link rel="stylesheet" href="https://assets-cdn.github.com/assets/gist-embed-9ec60d02ee0eb30530c9c2d12055b82db581fbb13b64b807fd63df9cd276d21b.css">')
document.write('<div id=\"gist8380521\" class=\"gist\">\n <div class=\"gist-file\">\n <div class=\"gist-data\">\n <div class=\"js-gist-file-update-container js-task-list-container file-box\">\n <div id=\"file-fb-arithmetic-c\" class=\"file\">\n \n\n <div itemprop=\"text\" class=\"blob-wrapper data type-c\">\n <table class=\"highlight tab-size js-file-line-container\" data-tab-size=\"8\">\n <tr>\n <td id=\"file-fb-arithmetic-c-L1\" class=\"blob-num js-line-number\" data-line-number=\"1\"><\/td>\n <td id=\"file-fb-arithmetic-c-LC1\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">&lt;<\/span>stdio.h<span class=\"pl-pds\">&gt;<\/span><\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"file-fb-arithmetic-c-L2\" class=\
document.querySelectorAll('iframe').forEach(ifr => {
// use onload property because we need to get the height
// after all content is fully loaded
ifr.onload = function () {
ifr.style.height = ifr.contentWindow.document.body.scrollHeight + 'px';
};
});
@pveyes
pveyes / error-handling.js
Created February 23, 2017 17:54
try catch async await
const rejectedPromise = () => new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('cuy')), 1000)
})
const bw = async function () {
try {
await rejectedPromise();
} catch (err) {
console.log('handle', err);
}
@pveyes
pveyes / eventHandler.js
Last active August 23, 2017 15:33
htmr simple yet powerful custom mapping
import convert from 'htmr';
class Link extends React.Component {
handleClick = e => {
e.preventDefault();
// do something here
alert('It works!');
}
render() {

Keybase proof

I hereby claim:

  • I am pveyes on github.
  • I am pveyes (https://keybase.io/pveyes) on keybase.
  • I have a public key ASAbOXMD5wF9bbTt74kbWNtIH8Azp9SnZUbaW5t40lfkjQo

To claim this, I am signing this object: